Refactor IsSpent(nullifier) for Sprout and Sapling domain separation.

We need separate functions for checking Sprout and Sapling nullifiers,
because they are in separate domains and aren't guaranteed to be
collision-resistant (otherwise there is a possibility of a nullifier
collision, however remote, between Sprout and Sapling causing the spend
of one to prevent the spend of the other).
This commit is contained in:
Simon
2018-08-02 23:12:25 -07:00
parent ec064abbdf
commit 3b6dd486b4
3 changed files with 18 additions and 14 deletions

View File

@@ -936,7 +936,8 @@ public:
bool SelectCoinsMinConf(const CAmount& nTargetValue, int nConfMine, int nConfTheirs, std::vector<COutput> vCoins, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, CAmount& nValueRet) const;
bool IsSpent(const uint256& hash, unsigned int n) const;
bool IsSpent(const uint256& nullifier) const;
bool IsSproutSpent(const uint256& nullifier) const;
bool IsSaplingSpent(const uint256& nullifier) const;
bool IsLockedCoin(uint256 hash, unsigned int n) const;
void LockCoin(COutPoint& output);