Skip to content

Commit

Permalink
Add consolidate cmd and response framework to the JSON RPC
Browse files Browse the repository at this point in the history
This adds the consolidate command to master, enabling a wallet to
consolidate small UTXOs into a large UTXO.
  • Loading branch information
cjepson committed Mar 4, 2016
1 parent cd8ea2e commit 7570926
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions dcrjson/dcrwalletextcmds.go
Expand Up @@ -7,6 +7,19 @@

package dcrjson

// ConsolidateCmd is a type handling custom marshaling and
// unmarshaling of consolidate JSON wallet extension
// commands.
type ConsolidateCmd struct {
Inputs int `json:"inputs"`
Account *string
}

// NewConsolidateCmd creates a new ConsolidateCmd.
func NewConsolidateCmd(inputs int, acct *string) *ConsolidateCmd {
return &ConsolidateCmd{Inputs: inputs, Account: acct}
}

// SStxInput represents the inputs to an SStx transaction. Specifically a
// transactionsha and output number pair, along with the output amounts.
type SStxInput struct {
Expand Down Expand Up @@ -469,6 +482,7 @@ func init() {
// server.
flags := UFWalletOnly

MustRegisterCmd("consolidate", (*ConsolidateCmd)(nil), flags)
MustRegisterCmd("createrawsstx", (*CreateRawSStxCmd)(nil), flags)
MustRegisterCmd("createrawssgentx", (*CreateRawSSGenTxCmd)(nil), flags)
MustRegisterCmd("createrawssrtx", (*CreateRawSSRtxCmd)(nil), flags)
Expand Down

0 comments on commit 7570926

Please sign in to comment.