Browse Source

SnapShot2

z_createrawtransaction
jl777 5 years ago
parent
commit
e2ddb727d4
  1. 41
      src/txdb.cpp
  2. 1
      src/txdb.h

41
src/txdb.cpp

@ -438,30 +438,31 @@ bool CBlockTreeDB::ReadAddressIndex(uint160 addressHash, int type,
bool getAddressFromIndex(const int &type, const uint160 &hash, std::string &address);
uint32_t komodo_segid32(char *coinaddr);
const std::map <std::string,int> ignoredMap = {
{"RReUxSs5hGE39ELU23DfydX8riUuzdrHAE", 1},
{"RMUF3UDmzWFLSKV82iFbMaqzJpUnrWjcT4", 1},
{"RA5imhVyJa7yHhggmBytWuDr923j2P1bxx", 1},
{"RBM5LofZFodMeewUzoMWcxedm3L3hYRaWg", 1},
{"RAdcko2d94TQUcJhtFHZZjMyWBKEVfgn4J", 1},
{"RLzUaZ934k2EFCsAiVjrJqM8uU1vmMRFzk", 1},
{"RMSZMWZXv4FhUgWhEo4R3AQXmRDJ6rsGyt", 1},
{"RUDrX1v5toCsJMUgtvBmScKjwCB5NaR8py", 1},
{"RMSZMWZXv4FhUgWhEo4R3AQXmRDJ6rsGyt", 1},
{"RRvwmbkxR5YRzPGL5kMFHMe1AH33MeD8rN", 1},
{"RQLQvSgpPAJNPgnpc8MrYsbBhep95nCS8L", 1},
{"RK8JtBV78HdvEPvtV5ckeMPSTojZPzHUTe", 1},
{"RHVs2KaCTGUMNv3cyWiG1jkEvZjigbCnD2", 1},
{"RE3SVaDgdjkRPYA6TRobbthsfCmxQedVgF", 1},
{"RW6S5Lw5ZCCvDyq4QV9vVy7jDHfnynr5mn", 1},
{"RTkJwAYtdXXhVsS3JXBAJPnKaBfMDEswF8", 1},
{"RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPVMY", 1} //Burnaddress for null privkey
#define DECLARE_IGNORELIST std::map <std::string,int> ignoredMap = { \
{"RReUxSs5hGE39ELU23DfydX8riUuzdrHAE", 1}, \
{"RMUF3UDmzWFLSKV82iFbMaqzJpUnrWjcT4", 1}, \
{"RA5imhVyJa7yHhggmBytWuDr923j2P1bxx", 1}, \
{"RBM5LofZFodMeewUzoMWcxedm3L3hYRaWg", 1}, \
{"RAdcko2d94TQUcJhtFHZZjMyWBKEVfgn4J", 1}, \
{"RLzUaZ934k2EFCsAiVjrJqM8uU1vmMRFzk", 1}, \
{"RMSZMWZXv4FhUgWhEo4R3AQXmRDJ6rsGyt", 1}, \
{"RUDrX1v5toCsJMUgtvBmScKjwCB5NaR8py", 1}, \
{"RMSZMWZXv4FhUgWhEo4R3AQXmRDJ6rsGyt", 1}, \
{"RRvwmbkxR5YRzPGL5kMFHMe1AH33MeD8rN", 1}, \
{"RQLQvSgpPAJNPgnpc8MrYsbBhep95nCS8L", 1}, \
{"RK8JtBV78HdvEPvtV5ckeMPSTojZPzHUTe", 1}, \
{"RHVs2KaCTGUMNv3cyWiG1jkEvZjigbCnD2", 1}, \
{"RE3SVaDgdjkRPYA6TRobbthsfCmxQedVgF", 1}, \
{"RW6S5Lw5ZCCvDyq4QV9vVy7jDHfnynr5mn", 1}, \
{"RTkJwAYtdXXhVsS3JXBAJPnKaBfMDEswF8", 1}, \
{"RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPVMY", 1} \
};
UniValue CBlockTreeDB::Snapshot2(int64_t dustthreshold,int32_t top,std::vector <std::pair<CAmount, std::string>> &vaddr)
int32_t CBlockTreeDB::Snapshot2(int64_t dustthreshold,int32_t top,std::vector <std::pair<CAmount, std::string>> &vaddr)
{
int64_t total = 0; int64_t totalAddresses = 0; std::string address;
int64_t utxos = 0; int64_t ignoredAddresses = 0;
DECLARE_IGNORELIST
boost::scoped_ptr<CDBIterator> iter(NewIterator());
std::map <std::string, CAmount> addressAmounts;
for (iter->SeekToLast(); iter->Valid(); iter->Prev())
@ -541,12 +542,14 @@ UniValue CBlockTreeDB::Snapshot2(int64_t dustthreshold,int32_t top,std::vector <
if ( top == topN )
break;
}
return(topN);
}
UniValue CBlockTreeDB::Snapshot(int top)
{
int64_t total = 0; int64_t totalAddresses = 0; std::string address;
int64_t utxos = 0; int64_t ignoredAddresses = 0;
DECLARE_IGNORELIST
boost::scoped_ptr<CDBIterator> iter(NewIterator());
std::map <std::string, CAmount> addressAmounts;
std::vector <std::pair<CAmount, std::string>> vaddr;

1
src/txdb.h

@ -116,6 +116,7 @@ public:
bool LoadBlockIndexGuts();
bool blockOnchainActive(const uint256 &hash);
UniValue Snapshot(int top);
int32_t Snapshot2(int64_t dustthreshold,int32_t top,std::vector <std::pair<CAmount, std::string>> &vaddr);
};
#endif // BITCOIN_TXDB_H

Loading…
Cancel
Save