File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
core/src/main/java/org/bitcoinj/wallet Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -2708,7 +2708,7 @@ public void updateTransactionDepth() {
27082708 // included once again. We could have a separate was-in-chain-and-now-isn't confidence type
27092709 // but this way is backwards compatible with existing software, and the new state probably
27102710 // wouldn't mean anything different to just remembering peers anyway.
2711- confidence .setDepthInBlocks (lastBlockSeenHeight - confidence .getAppearedAtChainHeight ());
2711+ confidence .setDepthInBlocks (lastBlockSeenHeight - confidence .getAppearedAtChainHeight () + 1 );
27122712 if (confidence .getDepthInBlocks () > context .getEventHorizon ())
27132713 confidence .clearBroadcastBy ();
27142714 confidenceChanged .put (tx , TransactionConfidence .Listener .ChangeReason .DEPTH );
@@ -6584,10 +6584,20 @@ public void unlockOutput(TransactionOutPoint outPoint) {
65846584 }
65856585
65866586 public void addManualNotifyConfidenceChangeTransaction (Transaction tx ) {
6587- manualConfidenceChangeTransactions .add (tx );
6587+ lock .lock ();
6588+ try {
6589+ manualConfidenceChangeTransactions .add (tx );
6590+ } finally {
6591+ lock .unlock ();
6592+ }
65886593 }
65896594
65906595 public void removeManualNotifyConfidenceChangeTransaction (Transaction tx ) {
6591- manualConfidenceChangeTransactions .remove (tx );
6596+ lock .lock ();
6597+ try {
6598+ manualConfidenceChangeTransactions .remove (tx );
6599+ } finally {
6600+ lock .unlock ();
6601+ }
65926602 }
65936603}
You can’t perform that action at this time.
0 commit comments