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
1 changed files with 4 additions and 2 deletions
|
@ -426,9 +426,11 @@ func (b *BlockChain) checkBlockSanity(block *btcutil.Block) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// A block must not have more than one coinbase.
|
// A block must not have more than one coinbase.
|
||||||
for _, tx := range transactions[1:] {
|
for i, tx := range transactions[1:] {
|
||||||
if isCoinBase(tx) {
|
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…
Add table
Reference in a new issue