Same problem after considered the preparlockunspent and sending to multisig address.

+1 vote
Hi,

Sorry facing the same problem, I have set up new nodes too and tested. Looks something I did not understand correctly.

Admin "1WmZSVrrqbgRhwtpu8gH9zx8kPa9fDjmHmqRCm"

"1WmZSVrrqbgRhwtpu8gH9zx8kPa9fDjmHmqRCm"    "02613a81dd3280e6a2d97cb4c23c5680a131317f6ea234deadec88f90bc6a85aea"    VH4bM7oBs7UMnmbBQYjcd1fLmTZfDDBPLpSfakdVbWRwV6aJ1n46uMVG
"1DGKG37gRk7gEBYwb793KLCeVrj2qBz9iZRgRt"    "02ac4f37074321266f7d85de1f63033c2b7cd6a3808b55af5189eae5cbc792ed09"    V9ihbagDYKeaJ5NKKm8WxEj2u5JwQ6uCG1pfQiwnUX8Hs8w2Q8uxodWy
"15wPDMHuMbzZMveZCvfYU5t4EsBM59WJdT3ZCC"    "03c3e921d991b8c68ed139939d85430927d2ee0bf8f23c6ff1627b23befabc529c"    V5W4mAVyYtTUNexmyPs411A2MduzWPxJmmB7v9qViaEfPFpwnny18tDm

multichain-cli ms issue "1WmZSVrrqbgRhwtpu8gH9zx8kPa9fDjmHmqRCm" Asset 1000 0.01

multichain-cli ms preparelockunspent '{"Asset":100}'

{
    "txid" : "cdb876679a23dc11098d11f3ea897317e85f8063a3a2ead539b9af70052e0c3c",
    "vout" : 0
}

multichain-cli ms createmultisig 2 '["02613a81dd3280e6a2d97cb4c23c5680a131317f6ea234deadec88f90bc6a85aea","02ac4f37074321266f7d85de1f63033c2b7cd6a3808b55af5189eae5cbc792ed09","03c3e921d991b8c68ed139939d85430927d2ee0bf8f23c6ff1627b23befabc529c"]'

{
    "address" : "3zsJnxJpUj5aURn5MEEhX6mYvsCvP6MquU9YJh",
    "redeemScript" : "redeemscript"
}

multichain-cli ms createrawtransaction '[{"txid" : "cdb876679a23dc11098d11f3ea897317e85f8063a3a2ead539b9af70052e0c3c","vout":0}]' '{"3zsJnxJpUj5aURn5MEEhX6mYvsCvP6MquU9YJh":{"Asset":100}}'

01000000013c0c2e0570afb939d5eaa2a363805fe8177389eaf3118d0911dc239a6776b8cd0000000000ffffffff0100000000000000002fa914066e82461d59a7fb5c630a3fe75177ff99fe8ccc871673706b713e0000000901000008c310270000000000007500000000

multichain-cli ms signrawtransaction 01000000013c0c2e0570afb939d5eaa2a363805fe8177389eaf3118d0911dc239a6776b8cd0000000000ffffffff0100000000000000002fa914066e82461d59a7fb5c630a3fe75177ff99fe8ccc871673706b713e0000000901000008c310270000000000007500000000

{
    "hex" : "01000000013c0c2e0570afb939d5eaa2a363805fe8177389eaf3118d0911dc239a6776b8cd000000006b483045022100ea05e61047b499356a76e1fe413e532c9c4f9dc7627d14f6195359784c48d866022053429028ad6d938d47ba6b80f7f7efa4c6e311483dd765bf8a0267859434fdca012102613a81dd3280e6a2d97cb4c23c5680a131317f6ea234deadec88f90bc6a85aeaffffffff0100000000000000002fa914066e82461d59a7fb5c630a3fe75177ff99fe8ccc871673706b713e0000000901000008c310270000000000007500000000",
    "complete" : true
}

multichain-cli ms decoderawtransaction 01000000013c0c2e0570afb939d5eaa2a363805fe8177389eaf3118d0911dc239a6776b8cd0000000000ffffffff0100000000000000002fa914066e82461d59a7fb5c630a3fe75177ff99fe8ccc871673706b713e0000000901000008c310270000000000007500000000

{
    "txid" : "2abd83fe203866de7c87be8e0b15c9c31c1ef51a40e495f6aff72b9cfa6323a9",
    "version" : 1,
    "locktime" : 0,
    "vin" : [
        {
            "txid" : "cdb876679a23dc11098d11f3ea897317e85f8063a3a2ead539b9af70052e0c3c",
            "vout" : 0,
            "scriptSig" : {
                "asm" : "",
                "hex" : ""
            },
            "sequence" : 4294967295
        }
    ],
    "vout" : [
        {
            "value" : 0.00000000,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "OP_HASH160 066e82461d59a7fb5c630a3fe75177ff99fe8ccc OP_EQUAL 73706b713e0000000901000008c31027000000000000 OP_DROP",
                "hex" : "a914066e82461d59a7fb5c630a3fe75177ff99fe8ccc871673706b713e0000000901000008c3102700000000000075",
                "reqSigs" : 1,
                "type" : "scripthash",
                "addresses" : [
                    "3zsJnxJpUj5aURn5MEEhX6mYvsCvP6MquU9YJh"
                ]
            },
            "assets" : [
                {
                    "name" : "Asset",
                    "issuetxid" : "08c350186dfe5c5d7a26f15921e32bb2f78f2a4b398c20ad950fc81adfa743ce",
                    "assetref" : "62-265-49928",
                    "qty" : 100.00000000,
                    "raw" : 10000
                }
            ],
            "permissions" : [
            ]
        }
    ],
    "data" : [
    ]
}

multichain-cli ms createrawtransaction '[{"txid":"2abd83fe203866de7c87be8e0b15c9c31c1ef51a40e495f6aff72b9cfa6323a9","vout":0,"scriptPubKey":"a914066e82461d59a7fb5c630a3fe75177ff99fe8ccc871673706b713e0000000901000008c3102700000000000075","redeemScript":"redeemscript"}]' '{"15wPDMHuMbzZMveZCvfYU5t4EsBM59WJdT3ZCC":{"Asset":100}}'

0100000001a92363fa9c2bf7aff695e4401af51e1cc3c9150b8ebe877cde663820fe83bd2a0000000000ffffffff0100000000000000003176a914248880b937630b79c3bfd9d1141f731690f98ec088ac1673706b713e0000000901000008c310270000000000007500000000

multichain-cli ms signrawtransaction '0100000001a92363fa9c2bf7aff695e4401af51e1cc3c9150b8ebe877cde663820fe83bd2a0000000000ffffffff0100000000000000003176a914248880b937630b79c3bfd9d1141f731690f98ec088ac1673706b713e0000000901000008c310270000000000007500000000' '[{"txid":"2abd83fe203866de7c87be8e0b15c9c31c1ef51a40e495f6aff72b9cfa6323a9","vout":0,"scriptPubKey":"a914066e82461d59a7fb5c630a3fe75177ff99fe8ccc871673706b713e0000000901000008c3102700000000000075","redeemScript":"redeemscript"}]' '["VH4bM7oBs7UMnmbBQYjcd1fLmTZfDDBPLpSfakdVbWRwV6aJ1n46uMVG"]'

{
    "hex" : "0100000001a92363fa9c2bf7aff695e4401af51e1cc3c9150b8ebe877cde663820fe83bd2a00000000b500483045022100ae7db7e20cde46b2d4dc294eec9a10621a56aeecbd2f3b836e60e259163363af02202b0682b7af4d33f036017158bc3e98622b0ca7f672df550bc0c24df932119250014c69redeemscriptffffffff0100000000000000003176a914248880b937630b79c3bfd9d1141f731690f98ec088ac1673706b713e0000000901000008c310270000000000007500000000",
    "complete" : false
}

Move to node2

multichain-cli ms signrawtransaction '0100000001a92363fa9c2bf7aff695e4401af51e1cc3c9150b8ebe877cde663820fe83bd2a00000000b500483045022100ae7db7e20cde46b2d4dc294eec9a10621a56aeecbd2f3b836e60e259163363af02202b0682b7af4d33f036017158bc3e98622b0ca7f672df550bc0c24df932119250014c69redeemscriptffffffff0100000000000000003176a914248880b937630b79c3bfd9d1141f731690f98ec088ac1673706b713e0000000901000008c310270000000000007500000000' '[{"txid":"2abd83fe203866de7c87be8e0b15c9c31c1ef51a40e495f6aff72b9cfa6323a9","vout":0,"scriptPubKey":"a914066e82461d59a7fb5c630a3fe75177ff99fe8ccc871673706b713e0000000901000008c3102700000000000075","redeemScript":"redeemscript"}]' '["V9ihbagDYKeaJ5NKKm8WxEj2u5JwQ6uCG1pfQiwnUX8Hs8w2Q8uxodWy"]'

{
    "hex" : "0100000001a92363fa9c2bf7aff695e4401af51e1cc3c9150b8ebe877cde663820fe83bd2a00000000fdfe0000483045022100ae7db7e20cde46b2d4dc294eec9a10621a56aeecbd2f3b836e60e259163363af02202b0682b7af4d33f036017158bc3e98622b0ca7f672df550bc0c24df93211925001483045022100e0c5d7ef600d1ecd896948d9a22783240490c2b304b6135c15e529db4cc955e402205df983f62f2a82a85a3acfa6783781b998066543daf433540d1c6fc5009a785f014c69redeemscriptffffffff0100000000000000003176a914248880b937630b79c3bfd9d1141f731690f98ec088ac1673706b713e0000000901000008c310270000000000007500000000",
    "complete" : true
}

multichain-cli ms sendrawtransaction 0100000001a92363fa9c2bf7aff695e4401af51e1cc3c9150b8ebe877cde663820fe83bd2a00000000fdfe0000483045022100ae7db7e20cde46b2d4dc294eec9a10621a56aeecbd2f3b836e60e259163363af02202b0682b7af4d33f036017158bc3e98622b0ca7f672df550bc0c24df93211925001483045022100e0c5d7ef600d1ecd896948d9a22783240490c2b304b6135c15e529db4cc955e402205df983f62f2a82a85a3acfa6783781b998066543daf433540d1c6fc5009a785f014c69redeemscriptffffffff0100000000000000003176a914248880b937630b79c3bfd9d1141f731690f98ec088ac1673706b713e0000000901000008c310270000000000007500000000

error: {"code":-26,"message":"18: bad-txns-inputs-spent"}
asked Feb 22, 2016 by ShenthilkumarCK

1 Answer

+2 votes
 
Best answer
You still have to call sendrawtransaction for transaction sending funds TO multisig address ("2abd83fe203866de7c87be8e0b15c9c31c1ef51a40e495f6aff72b9cfa6323a9"). Just add

multichain-cli ms sendrawtransaction 01000000013c0c2e0570afb939d5eaa2a363805fe8177389eaf3118d0911dc239a6776b8cd0000000000ffffffff0100000000000000002fa914066e82461d59a7fb5c630a3fe75177ff99fe8ccc871673706b713e0000000901000008c310270000000000007500000000

before calling decoderawtransaction.

Without sendrawtransaction even properly signed transaction is not relayed and its outputs cannot be spent (resulting in this error - bad-txns-inputs-spent).
answered Feb 23, 2016 by Michael
selected Feb 23, 2016 by ShenthilkumarCK
Excellent, It worked. Thanks a lot Michael.
Hi Shenthil

Quick check: The above steps were quite helpful in conducting a multisig transaction. However, I am facing the same error as above even with the sendrawtransaction proposed by Michael. Few questions:
- Did you use the exact instruction before decoderawtransaction? I needed to paste the longer-hex-blob which results from signrawtransaction prior to decoderawtransaction.
- Even after including the sendrawtransaction to multisig address, I am getting the same error message, (error code: -18).
Any suggestions?
Yes, I use the exact above instructions. Use the hex value output from signrawtransaction to sendrawtransaction as well as decoderawtransaction.
Got it working - thanks a lot, Shenthil!
...