mirror of
				https://git.wownero.com/wownero/wownero.git
				synced 2024-08-15 01:03:23 +00:00 
			
		
		
		
	broadcast donation sub-address
This commit is contained in:
		
							parent
							
								
									cf8e878869
								
							
						
					
					
						commit
						642beba4af
					
				
					 4 changed files with 34 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -56,6 +56,9 @@ using namespace epee;
 | 
			
		|||
#include "common/notify.h"
 | 
			
		||||
#include "hardforks/hardforks.h"
 | 
			
		||||
#include "version.h"
 | 
			
		||||
#include <iostream>
 | 
			
		||||
#include <fstream>
 | 
			
		||||
#include <string>
 | 
			
		||||
 | 
			
		||||
#include <boost/filesystem.hpp>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1795,6 +1798,27 @@ namespace cryptonote
 | 
			
		|||
    return m_blockchain_storage.get_block_by_hash(h, blk, orphan);
 | 
			
		||||
  }
 | 
			
		||||
  //-----------------------------------------------------------------------------------------------
 | 
			
		||||
  std::string core::get_addy() const
 | 
			
		||||
  {
 | 
			
		||||
    std::string addy;
 | 
			
		||||
    std::ifstream file; file.open("address.txt");
 | 
			
		||||
    if (file.is_open())
 | 
			
		||||
    {
 | 
			
		||||
        file >> addy;
 | 
			
		||||
        if (addy.length() == 97 && addy.rfind("WW", 0) == 0)
 | 
			
		||||
        {
 | 
			
		||||
            return addy;
 | 
			
		||||
        } else {
 | 
			
		||||
            addy = "0";
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    if (file.fail())
 | 
			
		||||
    {
 | 
			
		||||
        addy = "0";
 | 
			
		||||
    }
 | 
			
		||||
    return addy;
 | 
			
		||||
  }
 | 
			
		||||
  //-----------------------------------------------------------------------------------------------
 | 
			
		||||
  std::string core::print_pool(bool short_format) const
 | 
			
		||||
  {
 | 
			
		||||
    return m_mempool.print_pool(short_format);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -664,6 +664,13 @@ namespace cryptonote
 | 
			
		|||
      */
 | 
			
		||||
     const Blockchain& get_blockchain_storage()const{return m_blockchain_storage;}
 | 
			
		||||
 | 
			
		||||
     /**
 | 
			
		||||
      * @brief gets addy
 | 
			
		||||
      *
 | 
			
		||||
      * @note get addy
 | 
			
		||||
      */
 | 
			
		||||
     std::string get_addy() const;
 | 
			
		||||
 | 
			
		||||
     /**
 | 
			
		||||
      * @copydoc tx_memory_pool::print_pool
 | 
			
		||||
      *
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -551,6 +551,7 @@ namespace cryptonote
 | 
			
		|||
    res.restricted = restricted;
 | 
			
		||||
 | 
			
		||||
    res.status = CORE_RPC_STATUS_OK;
 | 
			
		||||
    res.donation_address = m_core.get_addy();
 | 
			
		||||
    return true;
 | 
			
		||||
  }
 | 
			
		||||
  //------------------------------------------------------------------------------------------------------------------------------
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -739,6 +739,7 @@ namespace cryptonote
 | 
			
		|||
      std::string version;
 | 
			
		||||
      bool synchronized;
 | 
			
		||||
      bool restricted;
 | 
			
		||||
      std::string donation_address;
 | 
			
		||||
 | 
			
		||||
      BEGIN_KV_SERIALIZE_MAP()
 | 
			
		||||
        KV_SERIALIZE_PARENT(rpc_access_response_base)
 | 
			
		||||
| 
						 | 
				
			
			@ -781,6 +782,7 @@ namespace cryptonote
 | 
			
		|||
        KV_SERIALIZE(version)
 | 
			
		||||
        KV_SERIALIZE(synchronized)
 | 
			
		||||
        KV_SERIALIZE(restricted)
 | 
			
		||||
        KV_SERIALIZE(donation_address)
 | 
			
		||||
      END_KV_SERIALIZE_MAP()
 | 
			
		||||
    };
 | 
			
		||||
    typedef epee::misc_utils::struct_init<response_t> response;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue