Skip to content

Commit 55ceaeb

Browse files
author
MarcoFalke
committed
Merge #18030: doc: Coin::IsSpent() can also mean never existed
1404c57 [doc] Coin: explain that IsSpent() can also mean never existed (Sjors Provoost) Pull request description: This can be especially confusing where `AccessCoin()` is used with logic like this: ```c++ while (iter.n < MAX_OUTPUTS_PER_BLOCK) { const Coin& alternate = view.AccessCoin(iter); if (!alternate.IsSpent()) return alternate; ``` ACKs for top commit: practicalswift: ACK 1404c57 MarcoFalke: ACK 1404c57 jnewbery: utACK 1404c57 Tree-SHA512: 418618dd7e08bd5cc8360e3501d0f57e34100e5101ad3b8e0a819923fa860f44c7f2fada0f8447a1af3c2601fd72bfe619b91ff2f26f7133ceaeb0c98b017b12
2 parents fd2b22b + 1404c57 commit 55ceaeb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/coins.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ class Coin
7575
::Unserialize(s, Using<TxOutCompression>(out));
7676
}
7777

78+
/** Either this coin never existed (see e.g. coinEmpty in coins.cpp), or it
79+
* did exist and has been spent.
80+
*/
7881
bool IsSpent() const {
7982
return out.IsNull();
8083
}

0 commit comments

Comments
 (0)