Guard against invalid coercion of int to u32 in FindSpendableInputs
This commit is contained in:
parent
e07e355e01
commit
44eb07a2bb
|
@ -2364,8 +2364,14 @@ SpendableInputs CWallet::FindSpendableInputs(
|
||||||
}
|
}
|
||||||
|
|
||||||
auto mit = mapWallet.find(noteMeta.GetOutPoint().hash);
|
auto mit = mapWallet.find(noteMeta.GetOutPoint().hash);
|
||||||
auto confirmations = mit->second.GetDepthInMainChain();
|
|
||||||
if (mit != mapWallet.end() && confirmations >= minDepth) {
|
// We should never get an outpoint from the Orchard wallet where
|
||||||
|
// the transaction does not exist in the main wallet.
|
||||||
|
assert(mit != mapWallet.end());
|
||||||
|
|
||||||
|
int confirmations = mit->second.GetDepthInMainChain();
|
||||||
|
if (confirmations < 0) continue;
|
||||||
|
if (confirmations >= minDepth) {
|
||||||
noteMeta.SetConfirmations(confirmations);
|
noteMeta.SetConfirmations(confirmations);
|
||||||
unspent.orchardNoteMetadata.push_back(noteMeta);
|
unspent.orchardNoteMetadata.push_back(noteMeta);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue