From 0d46ea9039b63242c22a90bd8a93e628b8ff43ce Mon Sep 17 00:00:00 2001 From: Hero-Gamer Date: Fri, 18 Sep 2026 20:32:31 -0400 Subject: [PATCH] rpc: return -22 TX decode failed for invalid rawtx Core mempool_accept expects -22 at line 98 (ff00baar). Previous returned -8 with tx decode: prefix. This is the only needle from #626 that matches existing contract. permitbaremultisig stays true per D-03, maxfeerate stays sat/vB with proxy BTC/kvB translation. txn-already-known vs in-mempool is separate PR. --- crates/rbitcoin-rpc/src/methods/mine.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/rbitcoin-rpc/src/methods/mine.rs b/crates/rbitcoin-rpc/src/methods/mine.rs index 6ab92c08a..f5569c583 100644 --- a/crates/rbitcoin-rpc/src/methods/mine.rs +++ b/crates/rbitcoin-rpc/src/methods/mine.rs @@ -1172,8 +1172,8 @@ pub(crate) fn submitblock(ctx: &RpcContext, params: &RpcParams) -> Result Result { - let b = hex_decode(hex).map_err(|e| rpc_error(ERR_INVALID_PARAMS, e.to_string()))?; - deserialize(&b).map_err(|e| rpc_error(ERR_INVALID_PARAMS, format!("tx decode: {e}"))) + let b = hex_decode(hex).map_err(|_| rpc_error(ERR_DESERIALIZATION, "TX decode failed"))?; + deserialize(&b).map_err(|_| rpc_error(ERR_DESERIALIZATION, "TX decode failed")) } pub(crate) fn tx_to_json(tx: &Transaction, extra: Option, network: BtcNetwork) -> Value {