diff --git a/src/bench/mempool_eviction.cpp b/src/bench/mempool_eviction.cpp --- a/src/bench/mempool_eviction.cpp +++ b/src/bench/mempool_eviction.cpp @@ -51,9 +51,9 @@ CMutableTransaction tx4 = CMutableTransaction(); tx4.vin.resize(2); - tx4.vin[0].prevout.SetNull(); + tx4.vin[0].prevout = COutPoint(); tx4.vin[0].scriptSig = CScript() << OP_4; - tx4.vin[1].prevout.SetNull(); + tx4.vin[1].prevout = COutPoint(); tx4.vin[1].scriptSig = CScript() << OP_4; tx4.vout.resize(2); tx4.vout[0].scriptPubKey = CScript() << OP_4 << OP_EQUAL; @@ -65,7 +65,7 @@ tx5.vin.resize(2); tx5.vin[0].prevout = COutPoint(tx4.GetId(), 0); tx5.vin[0].scriptSig = CScript() << OP_4; - tx5.vin[1].prevout.SetNull(); + tx5.vin[1].prevout = COutPoint(); tx5.vin[1].scriptSig = CScript() << OP_5; tx5.vout.resize(2); tx5.vout[0].scriptPubKey = CScript() << OP_5 << OP_EQUAL; @@ -77,7 +77,7 @@ tx6.vin.resize(2); tx6.vin[0].prevout = COutPoint(tx4.GetId(), 1); tx6.vin[0].scriptSig = CScript() << OP_4; - tx6.vin[1].prevout.SetNull(); + tx6.vin[1].prevout = COutPoint(); tx6.vin[1].scriptSig = CScript() << OP_6; tx6.vout.resize(2); tx6.vout[0].scriptPubKey = CScript() << OP_6 << OP_EQUAL; diff --git a/src/miner.cpp b/src/miner.cpp --- a/src/miner.cpp +++ b/src/miner.cpp @@ -190,7 +190,7 @@ // Create coinbase transaction. CMutableTransaction coinbaseTx; coinbaseTx.vin.resize(1); - coinbaseTx.vin[0].prevout.SetNull(); + coinbaseTx.vin[0].prevout = COutPoint(); coinbaseTx.vout.resize(1); coinbaseTx.vout[0].scriptPubKey = scriptPubKeyIn; coinbaseTx.vout[0].nValue = diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -38,7 +38,7 @@ uint32_t n; public: - COutPoint() { SetNull(); } + COutPoint() : txid(), n(-1) {} COutPoint(uint256 txidIn, uint32_t nIn) { txid = txidIn; n = nIn; @@ -52,11 +52,6 @@ READWRITE(n); } - void SetNull() { - txid.SetNull(); - n = uint32_t(-1); - } - bool IsNull() const { return txid.IsNull() && n == uint32_t(-1); } TxId GetTxId() const { return TxId(txid); } diff --git a/src/test/mempool_tests.cpp b/src/test/mempool_tests.cpp --- a/src/test/mempool_tests.cpp +++ b/src/test/mempool_tests.cpp @@ -541,9 +541,9 @@ CMutableTransaction tx4 = CMutableTransaction(); tx4.vin.resize(2); - tx4.vin[0].prevout.SetNull(); + tx4.vin[0].prevout = COutPoint(); tx4.vin[0].scriptSig = CScript() << OP_4; - tx4.vin[1].prevout.SetNull(); + tx4.vin[1].prevout = COutPoint(); tx4.vin[1].scriptSig = CScript() << OP_4; tx4.vout.resize(2); tx4.vout[0].scriptPubKey = CScript() << OP_4 << OP_EQUAL; @@ -555,7 +555,7 @@ tx5.vin.resize(2); tx5.vin[0].prevout = COutPoint(tx4.GetId(), 0); tx5.vin[0].scriptSig = CScript() << OP_4; - tx5.vin[1].prevout.SetNull(); + tx5.vin[1].prevout = COutPoint(); tx5.vin[1].scriptSig = CScript() << OP_5; tx5.vout.resize(2); tx5.vout[0].scriptPubKey = CScript() << OP_5 << OP_EQUAL; @@ -567,7 +567,7 @@ tx6.vin.resize(2); tx6.vin[0].prevout = COutPoint(tx4.GetId(), 1); tx6.vin[0].scriptSig = CScript() << OP_4; - tx6.vin[1].prevout.SetNull(); + tx6.vin[1].prevout = COutPoint(); tx6.vin[1].scriptSig = CScript() << OP_6; tx6.vout.resize(2); tx6.vout[0].scriptPubKey = CScript() << OP_6 << OP_EQUAL; diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -409,7 +409,7 @@ // Coinbase in mempool, template creation fails. tx.vin.resize(1); - tx.vin[0].prevout.SetNull(); + tx.vin[0].prevout = COutPoint(); tx.vin[0].scriptSig = CScript() << OP_0 << OP_1; tx.vout[0].nValue = Amount(0); hash = tx.GetId(); diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -120,7 +120,7 @@ txCredit.nLockTime = 0; txCredit.vin.resize(1); txCredit.vout.resize(1); - txCredit.vin[0].prevout.SetNull(); + txCredit.vin[0].prevout = COutPoint(); txCredit.vin[0].scriptSig = CScript() << CScriptNum(0) << CScriptNum(0); txCredit.vin[0].nSequence = CTxIn::SEQUENCE_FINAL; txCredit.vout[0].scriptPubKey = scriptPubKey; diff --git a/src/test/sigopcount_tests.cpp b/src/test/sigopcount_tests.cpp --- a/src/test/sigopcount_tests.cpp +++ b/src/test/sigopcount_tests.cpp @@ -89,7 +89,7 @@ const CScript &scriptSig) { creationTx.nVersion = 1; creationTx.vin.resize(1); - creationTx.vin[0].prevout.SetNull(); + creationTx.vin[0].prevout = COutPoint(); creationTx.vin[0].scriptSig = CScript(); creationTx.vout.resize(1); creationTx.vout[0].nValue = Amount(1); diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -323,7 +323,7 @@ CMutableTransaction outputm; outputm.nVersion = 1; outputm.vin.resize(1); - outputm.vin[0].prevout.SetNull(); + outputm.vin[0].prevout = COutPoint(); outputm.vin[0].scriptSig = CScript(); outputm.vout.resize(1); outputm.vout[0].nValue = Amount(1);