BlockHeader: types.BlockHeader{
Version: 1,
Height: 0,
- Timestamp: 1524549600,
+ Timestamp: 1524549600000,
BlockCommitment: types.BlockCommitment{
TransactionsMerkleRoot: merkleRoot,
TransactionStatusHash: txStatusHash,
BlockHeader: types.BlockHeader{
Version: 1,
Height: 0,
- Timestamp: 1528945000,
+ Timestamp: 1528945000000,
BlockCommitment: types.BlockCommitment{
TransactionsMerkleRoot: merkleRoot,
TransactionStatusHash: txStatusHash,
BlockHeader: types.BlockHeader{
Version: 1,
Height: 0,
- Timestamp: 1528945000,
+ Timestamp: 1528945000000,
BlockCommitment: types.BlockCommitment{
TransactionsMerkleRoot: merkleRoot,
TransactionStatusHash: txStatusHash,
TargetSecondsPerBlock = uint64(150)
SeedPerRetarget = uint64(256)
- // MaxTimeOffsetSeconds is the maximum number of seconds a block time is allowed to be ahead of the current time
- MaxTimeOffsetSeconds = uint64(60 * 60)
- MedianTimeBlocks = 11
+ // MaxTimeOffsetMs is the maximum number of seconds a block time is allowed to be ahead of the current time
+ MaxTimeOffsetMs = uint64(60 * 60 * 1000)
+ MedianTimeBlocks = 11
PayToWitnessPubKeyHashDataSize = 20
PayToWitnessScriptHashDataSize = 32
Version: 1,
Height: nextBlockHeight,
PreviousBlockHash: preBlockHash,
- Timestamp: uint64(time.Now().Unix()),
+ Timestamp: uint64(time.Now().UnixNano() / int64(time.Millisecond)),
BlockCommitment: types.BlockCommitment{},
},
}
BlockHeader: types.BlockHeader{
Version: 1,
Height: 0,
- Timestamp: 1528945000,
+ Timestamp: 1528945000000,
BlockCommitment: types.BlockCommitment{
TransactionsMerkleRoot: bc.Hash{V0: uint64(0x11)},
TransactionStatusHash: bc.Hash{V0: uint64(0x55)},
{
Version: 1,
Height: 0,
- Timestamp: 1528945000,
+ Timestamp: 1528945000000,
BlockCommitment: types.BlockCommitment{
TransactionsMerkleRoot: bc.Hash{V0: uint64(0x11)},
TransactionStatusHash: bc.Hash{V0: uint64(0x55)},
{
Version: 1,
Height: 1,
- Timestamp: 1528945000,
+ Timestamp: 1528945000000,
BlockCommitment: types.BlockCommitment{
TransactionsMerkleRoot: bc.Hash{V0: uint64(0x11)},
TransactionStatusHash: bc.Hash{V0: uint64(0x55)},
{
Version: 1,
Height: 3,
- Timestamp: 1528945000,
+ Timestamp: 1528945000000,
BlockCommitment: types.BlockCommitment{
TransactionsMerkleRoot: bc.Hash{V0: uint64(0x11)},
TransactionStatusHash: bc.Hash{V0: uint64(0x55)},
BlockHeader: types.BlockHeader{
Version: 1,
Height: 0,
- Timestamp: 1528945000,
+ Timestamp: 1528945000000,
BlockCommitment: types.BlockCommitment{
TransactionsMerkleRoot: bc.Hash{V0: uint64(0x11)},
TransactionStatusHash: bc.Hash{V0: uint64(0x55)},
BlockHeader: types.BlockHeader{
Version: 1,
Height: 0,
- Timestamp: 1528945000,
+ Timestamp: 1528945000000,
BlockCommitment: types.BlockCommitment{
TransactionsMerkleRoot: bc.Hash{V0: uint64(0x11)},
TransactionStatusHash: bc.Hash{V0: uint64(0x55)},
Version uint64 // The version of the block.
Height uint64 // The height of the block.
PreviousBlockHash bc.Hash // The hash of the previous block.
- Timestamp uint64 // The time of the block in seconds.
+ Timestamp uint64 // The time of the block in milliseconds.
BlockCommitment
BlockWitness
}
// Time returns the time represented by the Timestamp in block header.
func (bh *BlockHeader) Time() time.Time {
- return time.Unix(int64(bh.Timestamp), 0).UTC()
+ return time.Unix(0, int64(bh.Timestamp)*int64(time.Millisecond)).UTC()
}
// Hash returns complete hash of the block header.
Version: 1,
Height: 432234,
PreviousBlockHash: testutil.MustDecodeHash("c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0"),
- Timestamp: 1522908275,
+ Timestamp: 1522908275000,
BlockCommitment: BlockCommitment{
TransactionStatusHash: testutil.MustDecodeHash("b94301ea4e316bee00109f68d25beaca90aeff08e9bf439a37d91d7a3b5a1470"),
TransactionsMerkleRoot: testutil.MustDecodeHash("ad9ac003d08ff305181a345d64fe0b02311cc1a6ec04ab73f3318d90139bfe03"),
"01", // version
"eab01a", // block height
"c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0", // prev block hash
- "f3f896d605", // timestamp
- "40", // commitment extensible field length
+ "b8c2a0a3a92c", // timestamp
+ "40", // commitment extensible field length
"ad9ac003d08ff305181a345d64fe0b02311cc1a6ec04ab73f3318d90139bfe03", // transactions merkle root
"b94301ea4e316bee00109f68d25beaca90aeff08e9bf439a37d91d7a3b5a1470", // tx status hash
"040102beef", //BlockWitness
Version: 1,
Height: 10000,
PreviousBlockHash: testutil.MustDecodeHash("c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0"),
- Timestamp: 1528945000,
+ Timestamp: 1528945000000,
BlockCommitment: BlockCommitment{
TransactionsMerkleRoot: testutil.MustDecodeHash("ad9ac003d08ff305181a345d64fe0b02311cc1a6ec04ab73f3318d90139bfe03"),
TransactionStatusHash: testutil.MustDecodeHash("b94301ea4e316bee00109f68d25beaca90aeff08e9bf439a37d91d7a3b5a1470"),
"01", // version
"904e", // block height
"c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0", // prev block hash
- "e8b287d905", // timestamp
- "40", // commitment extensible field length
+ "c0fce4e1bf2c", // timestamp
+ "40", // commitment extensible field length
"ad9ac003d08ff305181a345d64fe0b02311cc1a6ec04ab73f3318d90139bfe03", // transactions merkle root
"b94301ea4e316bee00109f68d25beaca90aeff08e9bf439a37d91d7a3b5a1470", // tx status hash
"040102beef", //BlockWitness
Version: 1,
Height: 9223372036854775808, // Height > MaxInt64(9223372036854775807)
PreviousBlockHash: testutil.MustDecodeHash("c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0"),
- Timestamp: 1528945000,
+ Timestamp: 1528945000000,
BlockCommitment: BlockCommitment{
TransactionsMerkleRoot: testutil.MustDecodeHash("ad9ac003d08ff305181a345d64fe0b02311cc1a6ec04ab73f3318d90139bfe03"),
TransactionStatusHash: testutil.MustDecodeHash("b94301ea4e316bee00109f68d25beaca90aeff08e9bf439a37d91d7a3b5a1470"),
Version: 1,
Height: 9223372036854775807, // MaxInt64(9223372036854775807)
PreviousBlockHash: testutil.MustDecodeHash("c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0"),
- Timestamp: 1528945000,
+ Timestamp: 1528945000000,
BlockWitness: BlockWitness{Witness: [][]byte{[]byte{0xbe, 0xef}}},
},
wantHex: strings.Join([]string{
"01", // version
"ffffffffffffffff7f", // block height
"c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0", // prev block hash
- "e8b287d905", // timestamp
- "40", // commitment extensible field length
+ "c0fce4e1bf2c", // timestamp
+ "40", // commitment extensible field length
"0000000000000000000000000000000000000000000000000000000000000000", // transactions merkle root
"0000000000000000000000000000000000000000000000000000000000000000", // tx status hash
"040102beef", //BlockWitness
Version: 1,
Height: 9223372036854775807, // MaxInt64(9223372036854775807)
PreviousBlockHash: testutil.MustDecodeHash("c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0"),
- Timestamp: 1528945000,
+ Timestamp: 1528945000000,
BlockWitness: BlockWitness{Witness: [][]byte{[]byte{0xbe, 0xef}, []byte{0xab, 0xcd}, []byte{0xcd, 0x68}}},
},
wantHex: strings.Join([]string{
"01", // version
"ffffffffffffffff7f", // block height
"c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0", // prev block hash
- "e8b287d905", // timestamp
- "40", // commitment extensible field length
+ "c0fce4e1bf2c", // timestamp
+ "40", // commitment extensible field length
"0000000000000000000000000000000000000000000000000000000000000000", // transactions merkle root
"0000000000000000000000000000000000000000000000000000000000000000", // tx status hash
"0a0302beef02abcd02cd68", //BlockWitness
Version: 1,
Height: 9223372036854775807, // MaxInt64(9223372036854775807)
PreviousBlockHash: testutil.MustDecodeHash("c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0"),
- Timestamp: 1528945000,
+ Timestamp: 1528945000000,
BlockWitness: BlockWitness{Witness: [][]byte{[]byte{0xbe, 0xef}, nil, []byte{0xcd, 0x68}}},
},
wantHex: strings.Join([]string{
"01", // version
"ffffffffffffffff7f", // block height
"c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0", // prev block hash
- "e8b287d905", // timestamp
- "40", // commitment extensible field length
+ "c0fce4e1bf2c", // timestamp
+ "40", // commitment extensible field length
"0000000000000000000000000000000000000000000000000000000000000000", // transactions merkle root
"0000000000000000000000000000000000000000000000000000000000000000", // tx status hash
"080302beef0002cd68", //BlockWitness
Version: 1,
Height: 9223372036854775807, // MaxInt64(9223372036854775807)
PreviousBlockHash: testutil.MustDecodeHash("c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0"),
- Timestamp: 1528945000,
+ Timestamp: 1528945000000,
BlockWitness: BlockWitness{Witness: [][]byte{[]byte{0xbe, 0xef}, []byte{}, []byte{0xcd, 0x68}}},
},
wantHex: strings.Join([]string{
"01", // version
"ffffffffffffffff7f", // block height
"c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0", // prev block hash
- "e8b287d905", // timestamp
- "40", // commitment extensible field length
+ "c0fce4e1bf2c", // timestamp
+ "40", // commitment extensible field length
"0000000000000000000000000000000000000000000000000000000000000000", // transactions merkle root
"0000000000000000000000000000000000000000000000000000000000000000", // tx status hash
"080302beef0002cd68", //BlockWitness
Version: 1,
Height: 9223372036854775807, // MaxInt64(9223372036854775807)
PreviousBlockHash: testutil.MustDecodeHash("c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0"),
- Timestamp: 1528945000,
+ Timestamp: 1528945000000,
BlockWitness: BlockWitness{Witness: [][]byte{}},
},
wantHex: strings.Join([]string{
"01", // version
"ffffffffffffffff7f", // block height
"c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0", // prev block hash
- "e8b287d905", // timestamp
- "40", // commitment extensible field length
+ "c0fce4e1bf2c", // timestamp
+ "40", // commitment extensible field length
"0000000000000000000000000000000000000000000000000000000000000000", // transactions merkle root
"0000000000000000000000000000000000000000000000000000000000000000", // tx status hash
"0100", //BlockWitness
"01", // version
"904e", // block height
"c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0", // prev block hash
- "e8b287d905", // timestamp
- "40", // commitment extensible field length
+ "c0fce4e1bf2c", // timestamp
+ "40", // commitment extensible field length
"ad9ac003d08ff305181a345d64fe0b02311cc1a6ec04ab73f3318d90139bfe03", // transactions merkle root
"b94301ea4e316bee00109f68d25beaca90aeff08e9bf439a37d91d7a3b5a1470", // tx status hash
"040102beef", //BlockWitness
Version: 1,
Height: 10000,
PreviousBlockHash: testutil.MustDecodeHash("c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0"),
- Timestamp: 1528945000,
+ Timestamp: 1528945000000,
BlockCommitment: BlockCommitment{
TransactionsMerkleRoot: testutil.MustDecodeHash("ad9ac003d08ff305181a345d64fe0b02311cc1a6ec04ab73f3318d90139bfe03"),
TransactionStatusHash: testutil.MustDecodeHash("b94301ea4e316bee00109f68d25beaca90aeff08e9bf439a37d91d7a3b5a1470"),
"01", // version
"904e", // block height
"c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0", // prev block hash
- "e8b287d905", // timestamp
- "40", // commitment extensible field length
+ "c0fce4e1bf2c", // timestamp
+ "40", // commitment extensible field length
"ad9ac003d08ff305181a345d64fe0b02311cc1a6ec04ab73f3318d90139bfe03", // transactions merkle root
"b94301ea4e316bee00109f68d25beaca90aeff08e9bf439a37d91d7a3b5a1470", // tx status hash
"040102beef", //BlockWitness
Version: 1,
Height: 10000,
PreviousBlockHash: testutil.MustDecodeHash("c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0"),
- Timestamp: 1528945000,
+ Timestamp: 1528945000000,
BlockCommitment: BlockCommitment{
TransactionsMerkleRoot: testutil.MustDecodeHash("ad9ac003d08ff305181a345d64fe0b02311cc1a6ec04ab73f3318d90139bfe03"),
TransactionStatusHash: testutil.MustDecodeHash("b94301ea4e316bee00109f68d25beaca90aeff08e9bf439a37d91d7a3b5a1470"),
"01", // version
"904e", // block height
"c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0", // prev block hash
- "e8b287d905", // timestamp
- "40", // commitment extensible field length
+ "c0fce4e1bf2c", // timestamp
+ "40", // commitment extensible field length
"ad9ac003d08ff305181a345d64fe0b02311cc1a6ec04ab73f3318d90139bfe03", // transactions merkle root
"b94301ea4e316bee00109f68d25beaca90aeff08e9bf439a37d91d7a3b5a1470", // tx status hash
}, ""),
"01", // version
"908", // block height (error with odd length)
"c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0", // prev block hash
- "e8b287d905", // timestamp
- "40", // commitment extensible field length
+ "c0fce4e1bf2c", // timestamp
+ "40", // commitment extensible field length
"ad9ac003d08ff305181a345d64fe0b02311cc1a6ec04ab73f3318d90139bfe03", // transactions merkle root
"b94301ea4e316bee00109f68d25beaca90aeff08e9bf439a37d91d7a3b5a1470", // tx status hash
}, ""),
"01", // version
"ffffffffffffffffff", // block height
"c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0", // prev block hash
- "e8b287d905", // timestamp
- "40", // commitment extensible field length
+ "c0fce4e1bf2c", // timestamp
+ "40", // commitment extensible field length
"ad9ac003d08ff305181a345d64fe0b02311cc1a6ec04ab73f3318d90139bfe03", // transactions merkle root
"b94301ea4e316bee00109f68d25beaca90aeff08e9bf439a37d91d7a3b5a1470", // tx status hash
"040102beef", //BlockWitness
"01", // version
"ffffffffffffffff7f", // block height
"c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0", // prev block hash
- "e8b287d905", // timestamp
- "40", // commitment extensible field length
+ "c0fce4e1bf2c", // timestamp
+ "40", // commitment extensible field length
"ad9ac003d08ff305181a345d64fe0b02311cc1a6ec04ab73f3318d90139bfe03", // transactions merkle root
"b94301ea4e316bee00109f68d25beaca90aeff08e9bf439a37d91d7a3b5a14", // tx status hash
}, ""),
"01", // version
"ffffffffffffffff7f", // block height
"c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0", // prev block hash
- "e8b287d905", // timestamp
- "40", // commitment extensible field length
+ "c0fce4e1bf2c", // timestamp
+ "40", // commitment extensible field length
"ad9ac003d08ff305181a345d64fe0b02311cc1a6ec04ab73f3318d90139bfe03", // transactions merkle root
"b94301ea4e316bee00109f68d25beaca90aeff08e9bf439a37d91d7a3b5a1470", // tx status hash
"040102beef", //BlockWitness
Version: 1,
Height: 9223372036854775807, // MaxInt64(9223372036854775807)
PreviousBlockHash: testutil.MustDecodeHash("c34048bd60c4c13144fd34f408627d1be68f6cb4fdd34e879d6d791060ea73a0"),
- Timestamp: 1528945000,
+ Timestamp: 1528945000000,
BlockCommitment: BlockCommitment{
TransactionsMerkleRoot: testutil.MustDecodeHash("ad9ac003d08ff305181a345d64fe0b02311cc1a6ec04ab73f3318d90139bfe03"),
TransactionStatusHash: testutil.MustDecodeHash("b94301ea4e316bee00109f68d25beaca90aeff08e9bf439a37d91d7a3b5a1470"),
)
func checkBlockTime(b *bc.Block, parent *state.BlockNode) error {
- if b.Timestamp > uint64(time.Now().Unix())+consensus.MaxTimeOffsetSeconds {
+ if b.Timestamp > uint64(time.Now().UnixNano()/int64(time.Millisecond))+consensus.MaxTimeOffsetMs {
return errBadTimestamp
}
},
{
desc: "timestamp greater than max limit (blocktest#1006)",
- blockTime: 9999999999,
- parentTime: []uint64{1520000000},
+ blockTime: 99999999990000,
+ parentTime: []uint64{15200000000000},
err: errBadTimestamp,
},
{
desc: "timestamp of the block and the parent block are both greater than max limit (blocktest#1007)",
- blockTime: uint64(time.Now().Unix()) + consensus.MaxTimeOffsetSeconds + 2,
- parentTime: []uint64{uint64(time.Now().Unix()) + consensus.MaxTimeOffsetSeconds + 1},
+ blockTime: uint64(time.Now().UnixNano()/int64(time.Millisecond)) + consensus.MaxTimeOffsetMs + 2000,
+ parentTime: []uint64{uint64(time.Now().UnixNano()/int64(time.Millisecond)) + consensus.MaxTimeOffsetMs + 1000},
err: errBadTimestamp,
},
}
BlockHeader: &bc.BlockHeader{
Version: 1,
Height: 1,
- Timestamp: 1523352601,
+ Timestamp: 1523352601000,
PreviousBlockId: &bc.Hash{V0: 0},
},
},
parent: &state.BlockNode{
Version: 1,
Height: 0,
- Timestamp: 1523352600,
+ Timestamp: 1523352600000,
Hash: bc.Hash{V0: 0},
},
err: nil,
BlockHeader: &bc.BlockHeader{
Version: 1,
Height: 1,
- Timestamp: 1523352601,
+ Timestamp: 1523352601000,
PreviousBlockId: &bc.Hash{V0: 0},
TransactionsRoot: &bc.Hash{V0: 1},
},
parent: &state.BlockNode{
Version: 1,
Height: 0,
- Timestamp: 1523352600,
+ Timestamp: 1523352600000,
Hash: bc.Hash{V0: 0},
},
err: errMismatchedMerkleRoot,
BlockHeader: &bc.BlockHeader{
Version: 1,
Height: 1,
- Timestamp: 1523352601,
+ Timestamp: 1523352601000,
PreviousBlockId: &bc.Hash{V0: 0},
TransactionsRoot: &bc.Hash{V0: 6294987741126419124, V1: 12520373106916389157, V2: 5040806596198303681, V3: 1151748423853876189},
TransactionStatusHash: &bc.Hash{V0: 1},
parent: &state.BlockNode{
Version: 1,
Height: 0,
- Timestamp: 1523352600,
+ Timestamp: 1523352600000,
Hash: bc.Hash{V0: 0},
},
err: errMismatchedMerkleRoot,
BlockHeader: &bc.BlockHeader{
Version: 1,
Height: 1,
- Timestamp: 1523352601,
+ Timestamp: 1523352601000,
PreviousBlockId: &bc.Hash{V0: 0},
},
Transactions: []*bc.Tx{
parent: &state.BlockNode{
Version: 1,
Height: 0,
- Timestamp: 1523352600,
+ Timestamp: 1523352600000,
Hash: bc.Hash{V0: 0},
},
err: ErrWrongCoinbaseTransaction,
parent := &state.BlockNode{
Version: 1,
Height: 0,
- Timestamp: 1523352600,
+ Timestamp: 1523352600000,
Hash: bc.Hash{V0: 0},
}
block := &bc.Block{
BlockHeader: &bc.BlockHeader{
Version: 1,
Height: 1,
- Timestamp: 1523352601,
+ Timestamp: 1523352601000,
PreviousBlockId: &bc.Hash{V0: 0},
TransactionsRoot: &bc.Hash{V0: 1},
},
parent := &state.BlockNode{
Version: 1,
Height: 0,
- Timestamp: 1523352600,
+ Timestamp: 1523352600000,
Hash: bc.Hash{V0: 0},
}
block := &bc.Block{
BlockHeader: &bc.BlockHeader{
Version: 1,
Height: 1,
- Timestamp: 1523352601,
+ Timestamp: 1523352601000,
PreviousBlockId: &bc.Hash{V0: 0},
TransactionsRoot: &bc.Hash{V0: 10011341401654852692, V1: 8144266100226420640, V2: 18332298251154128538, V3: 7663092454615786384},
TransactionStatusHash: &bc.Hash{V0: 8682965660674182538, V1: 8424137560837623409, V2: 6979974817894224946, V3: 4673809519342015041},
block := &bc.Block{
BlockHeader: &bc.BlockHeader{
Height: 333,
- Timestamp: 1521625823,
+ Timestamp: 1521625823000,
},
}
valid: false,
},
{
- desc: "invalid timestamp, greater than MaxTimeOffsetSeconds from system time",
+ desc: "invalid timestamp, greater than MaxTimeOffsetMs from system time",
version: func() uint64 { return chain.BestBlockHeader().Version },
prevHeight: chain.BestBlockHeight,
- timestamp: func() uint64 { return uint64(time.Now().Unix()) + consensus.MaxTimeOffsetSeconds + 60 },
+ timestamp: func() uint64 { return uint64(time.Now().Unix()) + consensus.MaxTimeOffsetMs + 60 },
prevHash: chain.BestBlockHash,
valid: false,
},
BlockHeader: types.BlockHeader{
Height: 100,
PreviousBlockHash: testutil.MustDecodeHash("0ab29c0bd7bff3b3b7eb98802f8d5f8833884c86c0fb21559a65cc58dda99667"),
- Timestamp: 1522908275,
+ Timestamp: 1522908275000,
},
Transactions: []*types.Tx{
coinBaseTx(41250000000, "arbitrary block0"),
BlockHeader: types.BlockHeader{
Height: 101,
PreviousBlockHash: testutil.MustDecodeHash("0ab29c0bd7bff3b3b7eb98802f8d5f8833884c86c0fb21559a65cc58dda99667"),
- Timestamp: 1522908275,
+ Timestamp: 1522908275000,
},
Transactions: []*types.Tx{
coinBaseTx(41250000000, "arbitrary block1"),
BlockHeader: types.BlockHeader{
Height: 102,
PreviousBlockHash: testutil.MustDecodeHash("0ab29c0bd7bff3b3b7eb98802f8d5f8833884c86c0fb21559a65cc58dda99667"),
- Timestamp: 1522908275,
+ Timestamp: 1522908275000,
},
Transactions: []*types.Tx{
coinBaseTx(41250000000, "arbitrary block2"),
BlockHeader: types.BlockHeader{
Height: 102,
PreviousBlockHash: testutil.MustDecodeHash("0ab29c0bd7bff3b3b7eb98802f8d5f8833884c86c0fb21559a65cc58dda99667"),
- Timestamp: 1522908275,
+ Timestamp: 1522908275000,
},
Transactions: []*types.Tx{
coinBaseTx(41250000000, "arbitrary block3"),
BlockHeader: types.BlockHeader{
Height: 103,
PreviousBlockHash: testutil.MustDecodeHash("0ab29c0bd7bff3b3b7eb98802f8d5f8833884c86c0fb21559a65cc58dda99667"),
- Timestamp: 1522908275,
+ Timestamp: 1522908275000,
},
Transactions: []*types.Tx{
coinBaseTx(41250000000, "arbitrary block4"),
BlockHeader: types.BlockHeader{
Height: 104,
PreviousBlockHash: testutil.MustDecodeHash("0ab29c0bd7bff3b3b7eb98802f8d5f8833884c86c0fb21559a65cc58dda99667"),
- Timestamp: 1522908275,
+ Timestamp: 1522908275000,
},
Transactions: []*types.Tx{
coinBaseTx(41250000000, "arbitrary block5"),
BlockHeader: types.BlockHeader{
Height: 105,
PreviousBlockHash: testutil.MustDecodeHash("0ab29c0bd7bff3b3b7eb98802f8d5f8833884c86c0fb21559a65cc58dda99667"),
- Timestamp: 1522908275,
+ Timestamp: 1522908275000,
},
Transactions: []*types.Tx{
coinBaseTx(41250000000, "arbitrary block6"),
BlockHeader: types.BlockHeader{
Height: 106,
PreviousBlockHash: testutil.MustDecodeHash("0ab29c0bd7bff3b3b7eb98802f8d5f8833884c86c0fb21559a65cc58dda99667"),
- Timestamp: 1522908275,
+ Timestamp: 1522908275000,
},
Transactions: []*types.Tx{
coinBaseTx(41250000000, "arbitrary block7"),
BlockHeader: types.BlockHeader{
Height: 107,
PreviousBlockHash: testutil.MustDecodeHash("0ab29c0bd7bff3b3b7eb98802f8d5f8833884c86c0fb21559a65cc58dda99667"),
- Timestamp: 1522908275,
+ Timestamp: 1522908275000,
},
Transactions: []*types.Tx{
coinBaseTx(41250000000, "arbitrary block8"),
BlockHeader: types.BlockHeader{
Height: 108,
PreviousBlockHash: testutil.MustDecodeHash("0ab29c0bd7bff3b3b7eb98802f8d5f8833884c86c0fb21559a65cc58dda99667"),
- Timestamp: 1522908275,
+ Timestamp: 1522908275000,
},
Transactions: []*types.Tx{
coinBaseTx(41250000000, "arbitrary block9"),
BlockHeader: types.BlockHeader{
Height: 105,
PreviousBlockHash: testutil.MustDecodeHash("0ab29c0bd7bff3b3b7eb98802f8d5f8833884c86c0fb21559a65cc58dda99667"),
- Timestamp: 1522908275,
+ Timestamp: 1522908275000,
},
Transactions: []*types.Tx{
coinBaseTx(41250000000, "arbitrary block10"),
BlockHeader: types.BlockHeader{
Height: 105,
PreviousBlockHash: testutil.MustDecodeHash("0ab29c0bd7bff3b3b7eb98802f8d5f8833884c86c0fb21559a65cc58dda99667"),
- Timestamp: 1522908275,
+ Timestamp: 1522908275000,
},
Transactions: []*types.Tx{
coinBaseTx(41250000000, "arbitrary block11"),
BlockHeader: types.BlockHeader{
Height: 106,
PreviousBlockHash: testutil.MustDecodeHash("0ab29c0bd7bff3b3b7eb98802f8d5f8833884c86c0fb21559a65cc58dda99667"),
- Timestamp: 1522908275,
+ Timestamp: 1522908275000,
},
Transactions: []*types.Tx{
coinBaseTx(41250000000, "arbitrary block12"),
BlockHeader: types.BlockHeader{
Height: 107,
PreviousBlockHash: testutil.MustDecodeHash("0ab29c0bd7bff3b3b7eb98802f8d5f8833884c86c0fb21559a65cc58dda99667"),
- Timestamp: 1522908275,
+ Timestamp: 1522908275000,
},
Transactions: []*types.Tx{
coinBaseTx(41250000000, "arbitrary block13"),
BlockHeader: types.BlockHeader{
Height: 106,
PreviousBlockHash: testutil.MustDecodeHash("0ab29c0bd7bff3b3b7eb98802f8d5f8833884c86c0fb21559a65cc58dda99667"),
- Timestamp: 1522908275,
+ Timestamp: 1522908275000,
},
Transactions: []*types.Tx{
coinBaseTx(41250000000, "arbitrary block14"),
func (w *Wallet) buildAnnotatedUnconfirmedTx(tx *types.Tx) *query.AnnotatedTx {
annotatedTx := &query.AnnotatedTx{
ID: tx.ID,
- Timestamp: uint64(time.Now().Unix()),
+ Timestamp: uint64(time.Now().UnixNano() / int64(time.Millisecond)),
Inputs: make([]*query.AnnotatedInput, 0, len(tx.Inputs)),
Outputs: make([]*query.AnnotatedOutput, 0, len(tx.Outputs)),
Size: tx.SerializedSize,