coinbase verification at index > 0

This commit is contained in:
NikVolf 2016-11-22 03:27:37 +03:00
parent fff3c29e6d
commit eb24c5aff6
2 changed files with 5 additions and 0 deletions

View File

@ -130,6 +130,9 @@ impl ChainVerifier {
if sequence == 0 { return Ok(sigops); }
// must not be coinbase (sequence = 0 is returned above)
if transaction.is_coinbase() { return Err(TransactionError::MisplacedCoinbase(sequence)); }
if sigops >= MAX_BLOCK_SIGOPS { return Err(TransactionError::Sigops(sigops)); }
// strict pay-to-script-hash signature operations count toward block

View File

@ -77,6 +77,8 @@ pub enum TransactionError {
Sigops(usize),
/// Too many signature operations once p2sh operations included
SigopsP2SH(usize),
/// Coinbase transaction is found at position that is not 0
MisplacedCoinbase(usize),
}
#[derive(PartialEq, Debug)]