Add sendtoaddress support to btcctl.
This commit is contained in:
parent
038c8fb278
commit
979357c5f1
1 changed files with 6 additions and 0 deletions
|
@ -92,6 +92,7 @@ var commandHandlers = map[string]*handlerData{
|
||||||
makeSendFrom, "<account> <address> <amount> [minconf=1] [comment] [comment-to]"},
|
makeSendFrom, "<account> <address> <amount> [minconf=1] [comment] [comment-to]"},
|
||||||
"sendmany": &handlerData{2, 2, displayGeneric, []conversionHandler{nil, nil, toInt, nil}, makeSendMany, "<account> <{\"address\":amount,...}> [minconf=1] [comment]"},
|
"sendmany": &handlerData{2, 2, displayGeneric, []conversionHandler{nil, nil, toInt, nil}, makeSendMany, "<account> <{\"address\":amount,...}> [minconf=1] [comment]"},
|
||||||
"sendrawtransaction": &handlerData{1, 0, displayGeneric, nil, makeSendRawTransaction, "<hextx>"},
|
"sendrawtransaction": &handlerData{1, 0, displayGeneric, nil, makeSendRawTransaction, "<hextx>"},
|
||||||
|
"sendtoaddress": &handlerData{2, 2, displayGeneric, []conversionHandler{nil, toSatoshi, nil, nil}, makeSendToAddress, "<address> <amount> [comment] [comment-to]"},
|
||||||
"settxfee": &handlerData{1, 0, displayGeneric, []conversionHandler{toSatoshi}, makeSetTxFee, "<amount>"},
|
"settxfee": &handlerData{1, 0, displayGeneric, []conversionHandler{toSatoshi}, makeSetTxFee, "<amount>"},
|
||||||
"stop": &handlerData{0, 0, displayGeneric, nil, makeStop, ""},
|
"stop": &handlerData{0, 0, displayGeneric, nil, makeStop, ""},
|
||||||
"submitblock": &handlerData{1, 1, displayGeneric, nil, makeSubmitBlock, "<hexdata> [jsonparametersobject]"},
|
"submitblock": &handlerData{1, 1, displayGeneric, nil, makeSubmitBlock, "<hexdata> [jsonparametersobject]"},
|
||||||
|
@ -633,6 +634,11 @@ func makeSendRawTransaction(args []interface{}) (btcjson.Cmd, error) {
|
||||||
return btcjson.NewSendRawTransactionCmd("btcctl", args[0].(string))
|
return btcjson.NewSendRawTransactionCmd("btcctl", args[0].(string))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// makeSendToAddress generates the cmd struture for sendtoaddress commands.
|
||||||
|
func makeSendToAddress(args []interface{}) (btcjson.Cmd, error) {
|
||||||
|
return btcjson.NewSendToAddressCmd("btcctl", args[0].(string), args[1].(int64), args[2:]...)
|
||||||
|
}
|
||||||
|
|
||||||
// makeSetTxFee generates the cmd structure for settxfee commands.
|
// makeSetTxFee generates the cmd structure for settxfee commands.
|
||||||
func makeSetTxFee(args []interface{}) (btcjson.Cmd, error) {
|
func makeSetTxFee(args []interface{}) (btcjson.Cmd, error) {
|
||||||
return btcjson.NewSetTxFeeCmd("btcctl", args[0].(int64))
|
return btcjson.NewSetTxFeeCmd("btcctl", args[0].(int64))
|
||||||
|
|
Loading…
Reference in a new issue