Skip to content

Commit

Permalink
Wallet: Use local variable for blockHeight
Browse files Browse the repository at this point in the history
  • Loading branch information
ManfredKarrer authored and oscarguindzberg committed Dec 20, 2018
1 parent 5ed2576 commit 6ebcdd5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/src/main/java/org/bitcoinj/wallet/Wallet.java
Original file line number Diff line number Diff line change
Expand Up @@ -2107,7 +2107,8 @@ public void notifyNewBestBlock(StoredBlock block) throws VerificationException {
try {
// Store the new block hash.
setLastBlockSeenHash(newBlockHash);
setLastBlockSeenHeight(block.getHeight());
final int blockHeight = block.getHeight();
setLastBlockSeenHeight(blockHeight);
setLastBlockSeenTimeSecs(block.getHeader().getTimeSeconds());
// Notify all the BUILDING transactions of the new block.
// This is so that they can update their depth.
Expand All @@ -2127,7 +2128,7 @@ public void notifyNewBestBlock(StoredBlock block) throws VerificationException {
// included once again. We could have a separate was-in-chain-and-now-isn't confidence type
// but this way is backwards compatible with existing software, and the new state probably
// wouldn't mean anything different to just remembering peers anyway.
if (confidence.incrementDepthInBlocks(block.getHeight()) > context.getEventHorizon())
if (confidence.incrementDepthInBlocks(blockHeight) > context.getEventHorizon())
confidence.clearBroadcastBy();
confidenceChanged.put(tx, TransactionConfidence.Listener.ChangeReason.DEPTH);
}
Expand Down

0 comments on commit 6ebcdd5

Please sign in to comment.