MCPcopy Create free account
hub / github.com/ElementsProject/elements / SetSpentKeyState

Method SetSpentKeyState

src/wallet/wallet.cpp:893–910  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

891}
892
893void CWallet::SetSpentKeyState(WalletBatch& batch, const uint256& hash, unsigned int n, bool used, std::set<CTxDestination>& tx_destinations)
894{
895 AssertLockHeld(cs_wallet);
896 const CWalletTx* srctx = GetWalletTx(hash);
897 if (!srctx) return;
898
899 CTxDestination dst;
900 if (ExtractDestination(srctx->tx->vout[n].scriptPubKey, dst)) {
901 if (IsMine(dst)) {
902 if (used != IsAddressUsed(dst)) {
903 if (used) {
904 tx_destinations.insert(dst);
905 }
906 SetAddressUsed(batch, dst, used);
907 }
908 }
909 }
910}
911
912bool CWallet::IsSpentKey(const uint256& hash, unsigned int n) const
913{

Callers

nothing calls this directly

Calls 2

ExtractDestinationFunction · 0.85
insertMethod · 0.45

Tested by

no test coverage detected