MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / SetSpentKeyState

Method SetSpentKeyState

src/wallet/wallet.cpp:1011–1028  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1009}
1010
1011void CWallet::SetSpentKeyState(WalletBatch& batch, const Txid& hash, unsigned int n, bool used, std::set<CTxDestination>& tx_destinations)
1012{
1013 AssertLockHeld(cs_wallet);
1014 const CWalletTx* srctx = GetWalletTx(hash);
1015 if (!srctx) return;
1016
1017 CTxDestination dst;
1018 if (ExtractDestination(srctx->tx->vout[n].scriptPubKey, dst)) {
1019 if (IsMine(dst)) {
1020 if (used != IsAddressPreviouslySpent(dst)) {
1021 if (used) {
1022 tx_destinations.insert(dst);
1023 }
1024 SetAddressPreviouslySpent(batch, dst, used);
1025 }
1026 }
1027 }
1028}
1029
1030bool CWallet::IsSpentKey(const CScript& scriptPubKey) const
1031{

Callers

nothing calls this directly

Calls 2

ExtractDestinationFunction · 0.85
insertMethod · 0.45

Tested by

no test coverage detected