mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
Improve second coinbase error message.
Include the index at which the second coinbase transaction was found.
This commit is contained in:
parent
882d1c1687
commit
077e1ec336
@ -426,9 +426,11 @@ func (b *BlockChain) checkBlockSanity(block *btcutil.Block) error {
|
||||
}
|
||||
|
||||
// A block must not have more than one coinbase.
|
||||
for _, tx := range transactions[1:] {
|
||||
for i, tx := range transactions[1:] {
|
||||
if isCoinBase(tx) {
|
||||
return RuleError("block contains more than one coinbase")
|
||||
str := fmt.Sprintf("block contains second coinbase at "+
|
||||
"index %d", i)
|
||||
return RuleError(str)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user