mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-06 03:02:37 +02:00
Merge bitcoin/bitcoin#28121: include verbose "reject-details" field in testmempoolaccept response
b6f0593f43doc: add release note about testmempoolaccept debug-message (Matthew Zipkin)f9cac63523test: cover testmempoolaccept debug-message in RBF test (Matthew Zipkin)f9650e18earbf: remove unecessary newline at end of error string (Matthew Zipkin)221c789e91rpc: include verbose reject-details field in testmempoolaccept response (Matthew Zipkin) Pull request description: Adds a new field `reject-details` in `testmempoolaccept` responses to include `m_debug_message` from `ValidationState`. This string is the complete error message thrown by the mempool in response to `sendrawtransaction`. The extra verbosity is helpful to consumers of `testmempoolaccept`, which is sort of a debug tool anyway. example: > > { > "txid": "07d7a59a7bdad4c3a5070659ea04147c9b755ad9e173c52b6a38e017abf0f5b8", > "wtxid": "5dc243b1b92ee2f5a43134eb3e23449be03d1abb3d7f3c03c836ed0f13c50185", > "allowed": false, > "reject-reason": "insufficient fee", > "reject-details": "insufficient fee, rejecting replacement 07d7a59a7bdad4c3a5070659ea04147c9b755ad9e173c52b6a38e017abf0f5b8; new feerate 0.00300000 BTC/kvB <= old feerate 0.00300000 BTC/kvB" > } ACKs for top commit: rkrux: re-ACKb6f0593f43glozow: ACKb6f0593f43Tree-SHA512: 340b8023d59cefa84598879c4efdb7c399a3f62da126e87c595523f302e53d33098fc69da9c5f8c92b7580dc75466c66cea372051f935b197265648fe15c43a3
This commit is contained in:
@@ -109,18 +109,23 @@ class BIP66Test(BitcoinTestFramework):
|
||||
self.log.info("Test that transactions with non-DER signatures cannot appear in a block")
|
||||
block.nVersion = 4
|
||||
|
||||
spendtx = self.create_tx(self.coinbase_txids[1])
|
||||
coin_txid = self.coinbase_txids[1]
|
||||
spendtx = self.create_tx(coin_txid)
|
||||
unDERify(spendtx)
|
||||
spendtx.rehash()
|
||||
|
||||
# First we show that this tx is valid except for DERSIG by getting it
|
||||
# rejected from the mempool for exactly that reason.
|
||||
spendtx_txid = spendtx.hash
|
||||
spendtx_wtxid = spendtx.getwtxid()
|
||||
assert_equal(
|
||||
[{
|
||||
'txid': spendtx.hash,
|
||||
'wtxid': spendtx.getwtxid(),
|
||||
'txid': spendtx_txid,
|
||||
'wtxid': spendtx_wtxid,
|
||||
'allowed': False,
|
||||
'reject-reason': 'mandatory-script-verify-flag-failed (Non-canonical DER signature)',
|
||||
'reject-details': 'mandatory-script-verify-flag-failed (Non-canonical DER signature), ' +
|
||||
f"input 0 of {spendtx_txid} (wtxid {spendtx_wtxid}), spending {coin_txid}:0"
|
||||
}],
|
||||
self.nodes[0].testmempoolaccept(rawtxs=[spendtx.serialize().hex()], maxfeerate=0),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user