Changeset View
Changeset View
Standalone View
Standalone View
test/functional/mempool_accept.py
Show First 20 Lines • Show All 222 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
tx = FromHex(CTransaction(), raw_tx_reference) | tx = FromHex(CTransaction(), raw_tx_reference) | ||||
tx.vout[0].nValue *= -1 | tx.vout[0].nValue *= -1 | ||||
self.check_mempool_result( | self.check_mempool_result( | ||||
result_expected=[{'txid': tx.rehash( | result_expected=[{'txid': tx.rehash( | ||||
), 'allowed': False, 'reject-reason': '16: bad-txns-vout-negative'}], | ), 'allowed': False, 'reject-reason': '16: bad-txns-vout-negative'}], | ||||
rawtxs=[ToHex(tx)], | rawtxs=[ToHex(tx)], | ||||
) | ) | ||||
# The following two validations prevent overflow of the output amounts | |||||
# (see CVE-2010-5139). | |||||
self.log.info('A transaction with too large output value') | self.log.info('A transaction with too large output value') | ||||
tx = FromHex(CTransaction(), raw_tx_reference) | tx = FromHex(CTransaction(), raw_tx_reference) | ||||
tx.vout[0].nValue = 21000000 * COIN + 1 | tx.vout[0].nValue = 21000000 * COIN + 1 | ||||
self.check_mempool_result( | self.check_mempool_result( | ||||
result_expected=[{'txid': tx.rehash( | result_expected=[{'txid': tx.rehash( | ||||
), 'allowed': False, 'reject-reason': '16: bad-txns-vout-toolarge'}], | ), 'allowed': False, 'reject-reason': '16: bad-txns-vout-toolarge'}], | ||||
rawtxs=[ToHex(tx)], | rawtxs=[ToHex(tx)], | ||||
) | ) | ||||
▲ Show 20 Lines • Show All 112 Lines • Show Last 20 Lines |