From 66897677e438c4de8f4bf18432ebf67908ad571d Mon Sep 17 00:00:00 2001 From: shn <1961307973@qq.com> Date: Mon, 28 Oct 2024 14:14:25 +0800 Subject: [PATCH] Fix:nil pointer --- rpc/legacyrpc/methods.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rpc/legacyrpc/methods.go b/rpc/legacyrpc/methods.go index 8889f121ec..e75ee3cbe8 100644 --- a/rpc/legacyrpc/methods.go +++ b/rpc/legacyrpc/methods.go @@ -1713,6 +1713,9 @@ func signRawTransaction(icmd interface{}, w *wallet.Wallet, chainClient *chain.R if err != nil { return nil, err } + if result == nil { + return nil, errors.New("the utxo has been spent") + } script, err := hex.DecodeString(result.ScriptPubKey.Hex) if err != nil { return nil, err