Skip to content

Commit

Permalink
wallet: Match output depth.
Browse files Browse the repository at this point in the history
A txn in the chain tip is at depth=1
  • Loading branch information
tecnovert committed Sep 3, 2019
1 parent 888d53d commit 085b73d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 18)
define(_CLIENT_VERSION_REVISION, 1)
define(_CLIENT_VERSION_PARTICL, 4)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_BUILD, 1)
define(_CLIENT_VERSION_RC, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2019)
Expand Down
2 changes: 1 addition & 1 deletion src/anon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ bool VerifyMLSAG(const CTransaction &tx, CValidationState &state)
vCommitments.push_back(ao.commitment);
vpInCommits[i+k*nCols] = vCommitments.back().data;

if (state.m_spend_height - ao.nBlockHeight < consensus.nMinRCTOutputDepth) {
if (state.m_spend_height - ao.nBlockHeight + 1 < consensus.nMinRCTOutputDepth) {
LogPrint(BCLog::RINGCT, "%s: Low input depth %s\n", __func__, state.m_spend_height - ao.nBlockHeight);
return state.DoS(0, false, REJECT_NONSTANDARD, "bad-anonin-depth");
}
Expand Down
2 changes: 1 addition & 1 deletion src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ class CRegTestParams : public CChainParams {
// By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x00");

consensus.nMinRCTOutputDepth = 1;
consensus.nMinRCTOutputDepth = 2;

pchMessageStart[0] = 0x09;
pchMessageStart[1] = 0x12;
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/hdwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4854,7 +4854,7 @@ int CHDWallet::PickHidingOutputs(std::vector<std::vector<int64_t> > &vMI,
if (!pblocktree->ReadRCTOutput(nLastRCTOutIndex, ao)) {
return wserrorN(1, sError, __func__, _("Anon output not found in db, %d"), nLastRCTOutIndex);
}
if (ao.nBlockHeight > nBestHeight - (consensusParams.nMinRCTOutputDepth)) {
if (nBestHeight - ao.nBlockHeight + 1 < consensusParams.nMinRCTOutputDepth) {
nLastRCTOutIndex--;
continue;
}
Expand Down

0 comments on commit 085b73d

Please sign in to comment.