diff --git a/src/omnicore_pending.cpp b/src/omnicore_pending.cpp index 3b456cd743edb..3bc4f8dbdac49 100644 --- a/src/omnicore_pending.cpp +++ b/src/omnicore_pending.cpp @@ -1,9 +1,15 @@ #include "omnicore_pending.h" + #include "mastercore.h" +#include "mastercore_log.h" + +#include "uint256.h" #include "json/json_spirit_value.h" #include "json/json_spirit_writer_template.h" +#include + using json_spirit::Object; using json_spirit::Pair; using json_spirit::Value; @@ -14,7 +20,7 @@ using namespace mastercore; /** * Adds a transaction to the pending map using supplied parameters */ -void PendingAdd(const uint256 txid, const std::string& sendingAddress, const std::string& refAddress, uint16_t type, uint32_t propertyId, int64_t amount, uint32_t propertyIdDesired, int64_t amountDesired, int64_t action) +void PendingAdd(const uint256& txid, const std::string& sendingAddress, const std::string& refAddress, uint16_t type, uint32_t propertyId, int64_t amount, uint32_t propertyIdDesired, int64_t amountDesired, int64_t action) { Object txobj; std::string amountStr, amountDStr; @@ -64,7 +70,7 @@ void PendingAdd(const uint256 txid, const std::string& sendingAddress, const std } std::string txDesc = write_string(Value(txobj), false); CMPPending pending; - if (msc_debug_pending) file_log("%s(%s,%s,%s,%d,%u,%ld,%u,%ld,%d,%s)\n", __FUNCTION__, txid.GetHex().c_str(), sendingAddress.c_str(), refAddress.c_str(), + if (msc_debug_pending) file_log("%s(%s,%s,%s,%d,%u,%ld,%u,%ld,%d,%s)\n", __FUNCTION__, txid.GetHex(), sendingAddress, refAddress, type, propertyId, amount, propertyIdDesired, amountDesired, action, txDesc); if (update_tally_map(sendingAddress, propertyId, -amount, PENDING)) { pending.src = sendingAddress; @@ -81,13 +87,13 @@ void PendingAdd(const uint256 txid, const std::string& sendingAddress, const std * * NOTE: this is currently called for every bitcoin transaction prior to running through the parser */ -void PendingDelete(const uint256 txid) +void PendingDelete(const uint256& txid) { PendingMap::iterator it = my_pending.find(txid); if (it != my_pending.end()) { CMPPending *p_pending = &(it->second); int64_t src_amount = getMPbalance(p_pending->src, p_pending->prop, PENDING); - if (msc_debug_pending) file_log("%s(%s): amount=%ld\n", __FUNCTION__, txid.GetHex().c_str(), src_amount); + if (msc_debug_pending) file_log("%s(%s): amount=%d\n", __FUNCTION__, txid.GetHex(), src_amount); if (src_amount) update_tally_map(p_pending->src, p_pending->prop, p_pending->amount, PENDING); my_pending.erase(it); } diff --git a/src/omnicore_pending.h b/src/omnicore_pending.h index da2ab0d39a2cb..61e3793cdbd45 100644 --- a/src/omnicore_pending.h +++ b/src/omnicore_pending.h @@ -1,13 +1,16 @@ #ifndef OMNICORE_PENDING_H #define OMNICORE_PENDING_H -#include "uint256.h" +class uint256; + +#include +#include /** Adds a transaction to the pending map using supplied parameters. */ -void PendingAdd(const uint256 txid, const std::string& sendingAddress, const std::string& refAddress, uint16_t type, uint32_t propertyId, int64_t amount, uint32_t propertyIdDesired = 0, int64_t amountDesired = 0, int64_t action = 0); +void PendingAdd(const uint256& txid, const std::string& sendingAddress, const std::string& refAddress, uint16_t type, uint32_t propertyId, int64_t amount, uint32_t propertyIdDesired = 0, int64_t amountDesired = 0, int64_t action = 0); /** Deletes a transaction from the pending map and credits the amount back to the pending tally for the address. */ -void PendingDelete(const uint256 txid); +void PendingDelete(const uint256& txid); #endif // OMNICORE_PENDING_H