result: fix confirmations count for blocks

It's +1, current block actually had `-1` value calcuated that transformed into
4294967295.
This commit is contained in:
Roman Khimov 2021-02-18 17:16:15 +03:00
parent 8571107741
commit 9d6a5dc26f

View file

@ -48,7 +48,7 @@ func NewBlock(b *block.Block, chain core.Blockchainer) Block {
Base: &b.Base, Base: &b.Base,
BlockMetadataAndTx: BlockMetadataAndTx{ BlockMetadataAndTx: BlockMetadataAndTx{
Size: io.GetVarSize(b), Size: io.GetVarSize(b),
Confirmations: chain.BlockHeight() - b.Index - 1, Confirmations: chain.BlockHeight() - b.Index + 1,
Tx: make([]Tx, 0, len(b.Transactions)), Tx: make([]Tx, 0, len(b.Transactions)),
}, },
} }