mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-03-10 09:20:04 +01:00
TransactionConfidence: check for mutation of an already set source
This commit is contained in:
parent
e0b46d7c64
commit
d8e864fb24
1 changed files with 4 additions and 0 deletions
|
@ -523,8 +523,12 @@ public class TransactionConfidence {
|
|||
* from the peer to peer network, or make it ourselves, or receive it via Bluetooth, or import it from another app,
|
||||
* and so on. This information is useful for {@link CoinSelector} implementations to risk analyze
|
||||
* transactions and decide when to spend them.
|
||||
* <p>
|
||||
* Once set it's immutable.
|
||||
*/
|
||||
public synchronized void setSource(Source source) {
|
||||
checkState(this.source == Source.UNKNOWN || source == this.source, () ->
|
||||
"source cannot be set again: from " + this.source + " to " + source);
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue