Make v2 transactions standard.
This also corrects a rule about admitting large orphan transactions into the mempool, to account for v2-specific fields. Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
@@ -564,7 +564,7 @@ bool AddOrphanTx(const CTransaction& tx, NodeId peer)
|
||||
// have been mined or received.
|
||||
// 10,000 orphans, each of which is at most 5,000 bytes big is
|
||||
// at most 500 megabytes of orphans:
|
||||
unsigned int sz = tx.GetSerializeSize(SER_NETWORK, CTransaction::CURRENT_VERSION);
|
||||
unsigned int sz = tx.GetSerializeSize(SER_NETWORK, tx.nVersion);
|
||||
if (sz > 5000)
|
||||
{
|
||||
LogPrint("mempool", "ignoring large orphan tx (size: %u, hash: %s)\n", sz, hash.ToString());
|
||||
@@ -639,7 +639,7 @@ unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans)
|
||||
|
||||
bool IsStandardTx(const CTransaction& tx, string& reason)
|
||||
{
|
||||
if (tx.nVersion > CTransaction::CURRENT_VERSION || tx.nVersion < 1) {
|
||||
if (tx.nVersion > CTransaction::MAX_CURRENT_VERSION || tx.nVersion < CTransaction::MIN_CURRENT_VERSION) {
|
||||
reason = "version";
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user