btcsuite / btcwallet

A secure bitcoin wallet daemon written in Go (golang)
ISC License
1.15k stars 590 forks source link

"error": "address manager is locked" #869

Closed phanquocky closed 6 months ago

phanquocky commented 1 year ago

I try to sign raw transaction but it got this error. These are my commands I use to sign $ btcctl --wallet listunspent [ { "txid": "c17590fb7c92a29068f45e6902ce1fafefacf3f4a4e4e931bc002f780457b667", "vout": 1, "address": "mfmMfKWen1jecxtXhwgDNqtUF1WJqoQSXM", "account": "default", "scriptPubKey": "76a91402b954371b0ff733a36d3d53a3067f8dbf2f2ff688ac", "amount": 0.00498507, "confirmations": 1443, "spendable": true } ]

$ btcctl --wallet getnewaddress n4TbMvRnSuVoFNS3JDhFYpxeQ9HyUN5YMj

$ btcctl --wallet createrawtransaction '''[{"txid": "c17590fb7c92a29068f45e6902ce1fafefacf3f4a4e4e931bc002f780457b667", "vout": 1}] ''' ''' {"'n4TbMvRnSuVoFNS3JDhFYpxeQ9HyUN5YMj'": 0.00488507}''' 010000000167b65704782f00bc31e9e4a4f4f3acefaf1fce02695ef46890a2927cfb9075c10100000000ffffffff013b740700000000001976a914fba82bbfab94162aaff94a3619e45a70f26da13188ac00000000

$ btcctl --wallet --testnet signrawtransaction "010000000167b65704782f00bc31e9e4a4f4f3acefaf1fce02695ef46890a2927cfb9075c10100000000ffffffff013b740700000000001976a914fba82bbfab94162aaff94a3619e45a70f26da13188ac00000000" { "hex": "010000000167b65704782f00bc31e9e4a4f4f3acefaf1fce02695ef46890a2927cfb9075c10100000000ffffffff013b740700000000001976a914fba82bbfab94162aaff94a3619e45a70f26da13188ac00000000", "complete": false, "errors": [ { "txid": "c17590fb7c92a29068f45e6902ce1fafefacf3f4a4e4e931bc002f780457b667", "vout": 1, "scriptSig": "", "sequence": 4294967295, "error": "address manager is locked" } ] }

$ btcctl --wallet --testnet signrawtransactionwithwallet "010000000167b65704782f00bc31e9e4a4f4f3acefaf1fce02695ef46890a2927cfb9075c10100000000ffffffff013b740700000000001976a914fba82bbfab94162aaff94a3619e45a70f26da13188ac00000000" -32601: Method not found

guggero commented 1 year ago

Did you unlock your wallet?

phanquocky commented 1 year ago

Oh, It is my problem. I forgot unlock my wallet? Thank you very much

guggero commented 1 year ago

At least that would explain the address manager is locked error. Not sure what the command for unlocking is, I only really use btcwallet as a Golang library. Not sure about -32601: Method not found, maybe that RPC only exists in bitcoind and not in btcd?

phanquocky commented 1 year ago

This is the useful information for me, I didn't notice it. I appreciate that. Thank you