mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-12 16:17:53 +00:00
wallet: update stored witness in AddToWallet
Replace witness-stripped wallet transactions with full transactions;
this can happen when upgrading from a pre-segwit wallet to a segwit-
aware wallet.
Github-Pull: #11225
Rebased-From: d01a9682b1
This commit is contained in:
parent
62d18cdb89
commit
6b4d9f2736
@ -969,6 +969,15 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFlushOnClose)
|
|||||||
wtx.fFromMe = wtxIn.fFromMe;
|
wtx.fFromMe = wtxIn.fFromMe;
|
||||||
fUpdated = true;
|
fUpdated = true;
|
||||||
}
|
}
|
||||||
|
// If we have a witness-stripped version of this transaction, and we
|
||||||
|
// see a new version with a witness, then we must be upgrading a pre-segwit
|
||||||
|
// wallet. Store the new version of the transaction with the witness,
|
||||||
|
// as the stripped-version must be invalid.
|
||||||
|
// TODO: Store all versions of the transaction, instead of just one.
|
||||||
|
if (wtxIn.tx->HasWitness() && !wtx.tx->HasWitness()) {
|
||||||
|
wtx.SetTx(wtxIn.tx);
|
||||||
|
fUpdated = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//// debug print
|
//// debug print
|
||||||
|
Loading…
Reference in New Issue
Block a user