At Transaction.setBlockAppearance it states:

"Sets updatedAt to be the earliest valid block time where this tx was seen."

But the method: 
public void setUpdateTime(Date updatedAt) {
    this.updatedAt = updatedAt;
}

is called by the wallet.commit method thus the date is set once hte tx is 
created and committed to the wallet.
The check at Transaction.setBlockAppearance

if (bestChain && (updatedAt == null || updatedAt.getTime() == 0 || 
updatedAt.getTime() > blockTime)) {
            updatedAt = new Date(blockTime);
}

will cause that the block update time will not be applied as the updatedAt 
time is earlier as the block time.

It seems the code wants to handle casss with orphans but does not consider 
the wallet commit call.



Am Freitag, 12. Januar 2018 05:52:19 UTC-5 schrieb Andreas Schildbach:
>
> You can use Transaction.getUpdateTime() if you know a tx is confirmed 
> (see its confidence to know that). 
>
>
> On 01/09/2018 11:27 PM, Manfred Karrer wrote: 
> > What is the best way to access the date when the block containing a 
> > transaction was mined? 
> > 
> > With: 
> > <pre> 
> > final StoredBlock storedBlock = 
> vChain.getBlockStore().get(tx.getHash()); 
> > </pre> 
> > the storedBlock is null. 
> > 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"bitcoinj" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bitcoinj+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to