add pdf command, show block time in verify command
This commit is contained in:
@@ -2,8 +2,10 @@ package main
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.intruders.space/public/opentimestamps"
|
||||
@@ -137,8 +139,21 @@ func runVerifyCmd(cmd *cobra.Command, args []string) {
|
||||
}
|
||||
|
||||
att := seq.GetAttestation()
|
||||
|
||||
// Get the block time
|
||||
blockHash, err := bitcoin.GetBlockHash(int64(att.BitcoinBlockHeight))
|
||||
blockTime := ""
|
||||
if err == nil {
|
||||
blockHeader, err := bitcoin.GetBlockHeader(blockHash)
|
||||
if err == nil {
|
||||
// Format the block time
|
||||
blockTime = fmt.Sprintf(" (%s)", blockHeader.Timestamp.Format(time.RFC3339))
|
||||
}
|
||||
}
|
||||
|
||||
slog.Info("Verification successful",
|
||||
"block_height", att.BitcoinBlockHeight)
|
||||
"block_height", att.BitcoinBlockHeight,
|
||||
"block_time", strings.TrimPrefix(blockTime, " "))
|
||||
|
||||
if tx != nil {
|
||||
slog.Info("Bitcoin transaction", "txid", tx.TxHash().String())
|
||||
|
||||
Reference in New Issue
Block a user