From faffe2e084d6fe5e7dda058e980c8fa8a3df2c64 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Fri, 4 Mar 2022 11:36:03 -0700 Subject: [PATCH] Assert we never attempt to checkpoint the Orchard wallet at a negative block height. Co-authored-by: Daira Hopwood --- src/wallet/orchard.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wallet/orchard.h b/src/wallet/orchard.h index 5649255c5..8a9f8f6c0 100644 --- a/src/wallet/orchard.h +++ b/src/wallet/orchard.h @@ -82,6 +82,7 @@ public: * height scanned for transactions. This must be called exactly once per block. */ bool CheckpointNoteCommitmentTree(int nBlockHeight) { + assert(nBlockHeight >= 0); return orchard_wallet_checkpoint(inner.get(), (uint32_t) nBlockHeight); }