Add verbose boolean to getrawmempool

Also changes mempool to store CTxMemPoolEntries
to keep track of when they enter/exit the pool.
This commit is contained in:
Gavin Andresen
2013-11-11 17:35:14 +10:00
parent 0733c1bde6
commit 4d707d5120
12 changed files with 212 additions and 76 deletions

View File

@@ -702,8 +702,13 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
// you should add code here to check that the transaction does a
// reasonable number of ECDSA signature verifications.
int64_t nFees = view.GetValueIn(tx)-tx.GetValueOut();
unsigned int nSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
int64_t nValueIn = view.GetValueIn(tx);
int64_t nValueOut = tx.GetValueOut();
int64_t nFees = nValueIn-nValueOut;
double dPriority = view.GetPriority(tx, chainActive.Height());
CTxMemPoolEntry entry(tx, nFees, GetTime(), dPriority, chainActive.Height());
unsigned int nSize = entry.GetTxSize();
// Don't accept it if it can't get into a block
int64_t txMinFee = GetMinFee(tx, nSize, true, GMF_RELAY);
@@ -747,11 +752,10 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
{
return error("AcceptToMemoryPool: : ConnectInputs failed %s", hash.ToString().c_str());
}
// Store transaction in memory
pool.addUnchecked(hash, entry);
}
// Store transaction in memory
pool.addUnchecked(hash, tx);
g_signals.SyncTransaction(hash, tx, NULL);
return true;