mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2024-11-19 01:40:26 +01:00
TransactionConfidence: check for mutation of an already set source
This commit is contained in:
parent
e0b46d7c64
commit
d8e864fb24
@ -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…
Reference in New Issue
Block a user