aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-01-13 15:47:38 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2016-01-13 15:47:45 +0100
commitbe6d5a617d297bbbabcc56730976f9f025892e56 (patch)
treeb0557d6266bbdc2b9f7352fff55a29a17ee73269 /src/wallet/wallet.h
parent2cd004b1232abb23c66547f955200131354fc05d (diff)
parentd11fc1695c0453ef22a633e516726f82717dd1d9 (diff)
downloadbitcoin-be6d5a617d297bbbabcc56730976f9f025892e56.tar.xz
Merge pull request #7312
d11fc16 [Wallet] Call notification signal when a transaction is abandoned (Jonas Schnelli) df0e222 Add RPC test for abandoned and conflicted transactions. (Alex Morcos) 01e06d1 Add new rpc call: abandontransaction (Alex Morcos) 9e69717 Make wallet descendant searching more efficient (Alex Morcos)
Diffstat (limited to 'src/wallet/wallet.h')
-rw-r--r--src/wallet/wallet.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
index 9bbd52f14c..2176a5ff66 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -156,6 +156,10 @@ struct COutputEntry
/** A transaction with a merkle branch linking it to the block chain. */
class CMerkleTx : public CTransaction
{
+private:
+ /** Constant used in hashBlock to indicate tx has been abandoned */
+ static const uint256 ABANDON_HASH;
+
public:
uint256 hashBlock;
@@ -207,6 +211,9 @@ public:
bool IsInMainChain() const { const CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet) > 0; }
int GetBlocksToMaturity() const;
bool AcceptToMemoryPool(bool fLimitFree=true, bool fRejectAbsurdFee=true);
+ bool hashUnset() const { return (hashBlock.IsNull() || hashBlock == ABANDON_HASH); }
+ bool isAbandoned() const { return (hashBlock == ABANDON_HASH); }
+ void setAbandoned() { hashBlock = ABANDON_HASH; }
};
/**
@@ -567,7 +574,6 @@ private:
/* Mark a transaction (and its in-wallet descendants) as conflicting with a particular block. */
void MarkConflicted(const uint256& hashBlock, const uint256& hashTx);
-
void SyncMetaData(std::pair<TxSpends::iterator, TxSpends::iterator>);
public:
@@ -865,6 +871,9 @@ public:
bool GetBroadcastTransactions() const { return fBroadcastTransactions; }
/** Set whether this wallet broadcasts transactions. */
void SetBroadcastTransactions(bool broadcast) { fBroadcastTransactions = broadcast; }
+
+ /* Mark a transaction (and it in-wallet descendants) as abandoned so its inputs may be respent. */
+ bool AbandonTransaction(const uint256& hashTx);
};
/** A key allocated from the key pool. */