|
|
@ -559,8 +559,11 @@ bool CTransaction::AcceptToMemoryPool(bool fCheckInputs, bool* pfMissingInputs) |
|
|
|
return AcceptToMemoryPool(txdb, fCheckInputs, pfMissingInputs); |
|
|
|
return AcceptToMemoryPool(txdb, fCheckInputs, pfMissingInputs); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint64 nPooledTx = 0; |
|
|
|
|
|
|
|
|
|
|
|
bool CTransaction::AddToMemoryPoolUnchecked() |
|
|
|
bool CTransaction::AddToMemoryPoolUnchecked() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
printf("AcceptToMemoryPoolUnchecked(): size %lu\n", mapTransactions.size()); |
|
|
|
// Add to memory pool without checking anything. Don't call this directly,
|
|
|
|
// Add to memory pool without checking anything. Don't call this directly,
|
|
|
|
// call AcceptToMemoryPool to properly check the transaction first.
|
|
|
|
// call AcceptToMemoryPool to properly check the transaction first.
|
|
|
|
CRITICAL_BLOCK(cs_mapTransactions) |
|
|
|
CRITICAL_BLOCK(cs_mapTransactions) |
|
|
@ -570,6 +573,7 @@ bool CTransaction::AddToMemoryPoolUnchecked() |
|
|
|
for (int i = 0; i < vin.size(); i++) |
|
|
|
for (int i = 0; i < vin.size(); i++) |
|
|
|
mapNextTx[vin[i].prevout] = CInPoint(&mapTransactions[hash], i); |
|
|
|
mapNextTx[vin[i].prevout] = CInPoint(&mapTransactions[hash], i); |
|
|
|
nTransactionsUpdated++; |
|
|
|
nTransactionsUpdated++; |
|
|
|
|
|
|
|
++nPooledTx; |
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
@ -584,6 +588,7 @@ bool CTransaction::RemoveFromMemoryPool() |
|
|
|
mapNextTx.erase(txin.prevout); |
|
|
|
mapNextTx.erase(txin.prevout); |
|
|
|
mapTransactions.erase(GetHash()); |
|
|
|
mapTransactions.erase(GetHash()); |
|
|
|
nTransactionsUpdated++; |
|
|
|
nTransactionsUpdated++; |
|
|
|
|
|
|
|
--nPooledTx; |
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
@ -2887,6 +2892,9 @@ public: |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint64 nLastBlockTx = 0; |
|
|
|
|
|
|
|
uint64 nLastBlockSize = 0; |
|
|
|
|
|
|
|
|
|
|
|
CBlock* CreateNewBlock(CReserveKey& reservekey) |
|
|
|
CBlock* CreateNewBlock(CReserveKey& reservekey) |
|
|
|
{ |
|
|
|
{ |
|
|
|
CBlockIndex* pindexPrev = pindexBest; |
|
|
|
CBlockIndex* pindexPrev = pindexBest; |
|
|
@ -2974,6 +2982,7 @@ CBlock* CreateNewBlock(CReserveKey& reservekey) |
|
|
|
// Collect transactions into block
|
|
|
|
// Collect transactions into block
|
|
|
|
map<uint256, CTxIndex> mapTestPool; |
|
|
|
map<uint256, CTxIndex> mapTestPool; |
|
|
|
uint64 nBlockSize = 1000; |
|
|
|
uint64 nBlockSize = 1000; |
|
|
|
|
|
|
|
uint64 nBlockTx = 0; |
|
|
|
int nBlockSigOps = 100; |
|
|
|
int nBlockSigOps = 100; |
|
|
|
while (!mapPriority.empty()) |
|
|
|
while (!mapPriority.empty()) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -3008,6 +3017,7 @@ CBlock* CreateNewBlock(CReserveKey& reservekey) |
|
|
|
pblock->vtx.push_back(tx); |
|
|
|
pblock->vtx.push_back(tx); |
|
|
|
nBlockSize += nTxSize; |
|
|
|
nBlockSize += nTxSize; |
|
|
|
nBlockSigOps += nTxSigOps; |
|
|
|
nBlockSigOps += nTxSigOps; |
|
|
|
|
|
|
|
++nBlockTx; |
|
|
|
|
|
|
|
|
|
|
|
// Add transactions that depend on this one to the priority queue
|
|
|
|
// Add transactions that depend on this one to the priority queue
|
|
|
|
uint256 hash = tx.GetHash(); |
|
|
|
uint256 hash = tx.GetHash(); |
|
|
@ -3024,6 +3034,11 @@ CBlock* CreateNewBlock(CReserveKey& reservekey) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nLastBlockTx = nBlockTx; |
|
|
|
|
|
|
|
nLastBlockSize = nBlockSize; |
|
|
|
|
|
|
|
printf("CreateNewBlock(): total size %lu\n", nBlockSize); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
pblock->vtx[0].vout[0].nValue = GetBlockValue(pindexPrev->nHeight+1, nFees); |
|
|
|
pblock->vtx[0].vout[0].nValue = GetBlockValue(pindexPrev->nHeight+1, nFees); |
|
|
|
|
|
|
|
|
|
|
|