mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Make CWalletTx store a CTransactionRef instead of inheriting
This commit is contained in:
@@ -86,7 +86,7 @@ BOOST_AUTO_TEST_CASE(acc_orderupgrade)
|
||||
{
|
||||
CMutableTransaction tx(wtx);
|
||||
--tx.nLockTime; // Just to change the hash :)
|
||||
*static_cast<CTransaction*>(&wtx) = CTransaction(tx);
|
||||
wtx.SetTx(MakeTransactionRef(std::move(tx)));
|
||||
}
|
||||
pwalletMain->AddToWallet(wtx);
|
||||
vpwtx.push_back(&pwalletMain->mapWallet[wtx.GetHash()]);
|
||||
@@ -96,7 +96,7 @@ BOOST_AUTO_TEST_CASE(acc_orderupgrade)
|
||||
{
|
||||
CMutableTransaction tx(wtx);
|
||||
--tx.nLockTime; // Just to change the hash :)
|
||||
*static_cast<CTransaction*>(&wtx) = CTransaction(tx);
|
||||
wtx.SetTx(MakeTransactionRef(std::move(tx)));
|
||||
}
|
||||
pwalletMain->AddToWallet(wtx);
|
||||
vpwtx.push_back(&pwalletMain->mapWallet[wtx.GetHash()]);
|
||||
|
||||
@@ -42,7 +42,7 @@ static void add_coin(const CAmount& nValue, int nAge = 6*24, bool fIsFromMe = fa
|
||||
// so stop vin being empty, and cache a non-zero Debit to fake out IsFromMe()
|
||||
tx.vin.resize(1);
|
||||
}
|
||||
CWalletTx* wtx = new CWalletTx(&wallet, tx);
|
||||
CWalletTx* wtx = new CWalletTx(&wallet, MakeTransactionRef(std::move(tx)));
|
||||
if (fIsFromMe)
|
||||
{
|
||||
wtx->fDebitCached = true;
|
||||
|
||||
Reference in New Issue
Block a user