Skip to content

Commit

Permalink
Fix issue: Transaction.updatedAt is not set at new block bisq-network#11
Browse files Browse the repository at this point in the history
  • Loading branch information
ManfredKarrer authored and oscarguindzberg committed Jan 3, 2019
1 parent 941998c commit 0808126
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/src/main/java/org/bitcoinj/core/Transaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,14 @@ public boolean isPending() {
*/
public void setBlockAppearance(StoredBlock block, boolean bestChain, int relativityOffset) {
long blockTime = block.getHeader().getTimeSeconds() * 1000;
if (bestChain && (updatedAt == null || updatedAt.getTime() == 0 || updatedAt.getTime() > blockTime)) {

/* if (bestChain && (updatedAt == null || updatedAt.getTime() == 0 || updatedAt.getTime() > blockTime)) {
updatedAt = new Date(blockTime);
}*/
// We removed for the checks to not overwrite updatedAt in cases for re-orgs.
// updatedAt is set by wallet.commit and thus the new block would never set the value.
// If there is a re-org the best block is called last as stated in the doc above so the values will be correct.
if (bestChain) {
updatedAt = new Date(blockTime);
}

Expand Down

0 comments on commit 0808126

Please sign in to comment.