Skip to content

Commit fa42f5b

Browse files
committed
asset+proof: add block timestamp to ChainAsset
This adds a new `AnchorBlockTimestamp` field to the `ChainAsset` struct which gets set to the timestamp of the block header encoded in the `Proof`.
1 parent 4baafb3 commit fa42f5b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

asset/asset.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,6 +1863,10 @@ type ChainAsset struct {
18631863
// tx.
18641864
AnchorBlockHeight uint32
18651865

1866+
// AnchorBlockTimestamp is the Unix timestamp of the block that mined
1867+
// the anchor tx.
1868+
AnchorBlockTimestamp int64
1869+
18661870
// AnchorOutpoint is the outpoint that commits to the asset.
18671871
AnchorOutpoint wire.OutPoint
18681872

proof/proof.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,7 @@ func (p *Proof) ToChainAsset() (asset.ChainAsset, error) {
530530
AnchorBlockHash: p.BlockHeader.BlockHash(),
531531
AnchorOutpoint: p.OutPoint(),
532532
AnchorBlockHeight: p.BlockHeight,
533+
AnchorBlockTimestamp: p.BlockHeader.Timestamp.Unix(),
533534
AnchorInternalKey: p.InclusionProof.InternalKey,
534535
AnchorMerkleRoot: merkleRoot[:],
535536
AnchorTapscriptSibling: tsSibling,

0 commit comments

Comments
 (0)