Facebook
From Big Cat, 2 Months ago, written in Diff-output.
Embed
Download Paste or View Raw
Hits: 59
  1. diff --git a/README.md b/README.md
  2. index ca8b011c..44413649 100644
  3. --- a/README.md
  4. +++ b/README.md
  5. @@ -6,7 +6,7 @@ monad
  6.  [![ISC License](https://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org)
  7.  [![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/monasuite/monad)
  8.  
  9. -monad is an alternative full node monacoin implementation written in Go (golang).
  10. +monad is an alternative full node bitcoin implementation written in Go (golang).
  11.  
  12.  This project is currently under active development and is in a Beta state.  It
  13.  is extremely stable and has been in production use since October 2013.
  14. @@ -25,7 +25,7 @@ ensures all individual transactions admitted to the pool follow the rules
  15.  required by the block chain and also includes more strict checks which filter
  16.  transactions based on miner requirements ("standard" transactions).
  17.  
  18. -One key difference between monad and Monacoin Core is that monad does *NOT* include
  19. +One key difference between monad and Bitcoin Core is that monad does *NOT* include
  20.  wallet functionality and this was a very intentional design decision.  See the
  21.  blog entry [here](https://web.archive.org/web/20171125143919/https://blog.conformal.com/btcd-not-your-moms-bitcoin-daemon)
  22.  for more details.  This means you can't actually make or receive payments
  23. @@ -104,6 +104,12 @@ Launch monad from your Start menu.
  24.  $ ./monad
  25.  ```
  26.  
  27. +## IRC
  28. +
  29. +- irc.freenode.net
  30. +- channel #monad
  31. +- [webchat](https://webchat.freenode.net/?channels=monad)
  32. +
  33.  ## Issue Tracker
  34.  
  35.  The [integrated github issue tracker](https://github.com/monasuite/monad/issues)
  36. diff --git a/btcjson/chainsvrcmds.go b/btcjson/chainsvrcmds.go
  37. index 701af3a6..9c313e75 100644
  38. --- a/btcjson/chainsvrcmds.go
  39. +++ b/btcjson/chainsvrcmds.go
  40. @@ -13,7 +13,6 @@ import (
  41.         "fmt"
  42.  
  43.         "github.com/monasuite/monad/wire"
  44. -       "github.com/shopspring/decimal"
  45.  )
  46.  
  47.  // AddNodeSubCmd defines the type used in the addnode JSON-RPC command for the
  48. @@ -58,7 +57,7 @@ type TransactionInput struct {
  49.  // CreateRawTransactionCmd defines the createrawtransaction JSON-RPC command.
  50.  type CreateRawTransactionCmd struct {
  51.         Inputs   []TransactionInput
  52. -       Amounts  map[string]decimal.Decimal `jsonrpcusage:"{\"address\":amount,...}"` // In BTC
  53. +       Amounts  map[string]float64 `jsonrpcusage:"{\"address\":amount,...}"` // In BTC
  54.         LockTime *int64
  55.  }
  56.  
  57. @@ -119,7 +118,7 @@ func NewDumpVolatileCheckpointCmd() *DumpVolatileCheckpointCmd {
  58.  //
  59.  // Amounts are in BTC. Passing in nil and the empty slice as inputs is equivalent,
  60.  // both gets interpreted as the empty slice.
  61. -func NewCreateRawTransactionCmd(inputs []TransactionInput, amounts map[string]decimal.Decimal,
  62. +func NewCreateRawTransactionCmd(inputs []TransactionInput, amounts map[string]float64,
  63.         lockTime *int64) *CreateRawTransactionCmd {
  64.         // to make sure we're serializing this to the empty list and not null, we
  65.         // explicitly initialize the list
  66. @@ -1032,9 +1031,9 @@ func init() {
  67.         MustRegisterCmd("checkpoint", (*CheckpointCmd)(nil), flags)
  68.         MustRegisterCmd("dumpcheckpoint", (*DumpCheckpointCmd)(nil), flags)
  69.         MustRegisterCmd("dumpvolatilecheckpoint", (*DumpVolatileCheckpointCmd)(nil), flags)
  70. -       MustRegisterCmd("fundrawtransaction", (*FundRawTransactionCmd)(nil), flags)
  71.         MustRegisterCmd("decoderawtransaction", (*DecodeRawTransactionCmd)(nil), flags)
  72.         MustRegisterCmd("decodescript", (*DecodeScriptCmd)(nil), flags)
  73. +       MustRegisterCmd("fundrawtransaction", (*FundRawTransactionCmd)(nil), flags)
  74.         MustRegisterCmd("getaddednodeinfo", (*GetAddedNodeInfoCmd)(nil), flags)
  75.         MustRegisterCmd("getbestblockhash", (*GetBestBlockHashCmd)(nil), flags)
  76.         MustRegisterCmd("getblock", (*GetBlockCmd)(nil), flags)
  77. diff --git a/btcjson/chainsvrcmds_test.go b/btcjson/chainsvrcmds_test.go
  78. index 6f5e2a13..2d8abc34 100644
  79. --- a/btcjson/chainsvrcmds_test.go
  80. +++ b/btcjson/chainsvrcmds_test.go
  81. @@ -14,7 +14,6 @@ import (
  82.  
  83.         "github.com/monasuite/monad/btcjson"
  84.         "github.com/monasuite/monad/wire"
  85. -       "github.com/shopspring/decimal"
  86.  )
  87.  
  88.  // TestChainSvrCmds tests all of the chain server commands marshal and unmarshal
  89. @@ -53,28 +52,28 @@ func TestChainSvrCmds(t *testing.T) {
  90.                                 txInputs := []btcjson.TransactionInput{
  91.                                         {Txid: "123", Vout: 1},
  92.                                 }
  93. -                               amounts := map[string]decimal.Decimal{"456": decimal.NewFromFloat(.0123)}
  94. +                               amounts := map[string]float64{"456": .0123}
  95.                                 return btcjson.NewCreateRawTransactionCmd(txInputs, amounts, nil)
  96.                         },
  97. -                       marshalled: `{"jsonrpc":"1.0","method":"createrawtransaction","params":[[{"txid":"123","vout":1}],{"456":"0.0123"}],"id":1}`,
  98. +                       marshalled: `{"jsonrpc":"1.0","method":"createrawtransaction","params":[[{"txid":"123","vout":1}],{"456":0.0123}],"id":1}`,
  99.                         unmarshalled: &btcjson.CreateRawTransactionCmd{
  100.                                 Inputs:  []btcjson.TransactionInput{{Txid: "123", Vout: 1}},
  101. -                               Amounts: map[string]decimal.Decimal{"456": decimal.NewFromFloat(.0123)},
  102. +                               Amounts: map[string]float64{"456": .0123},
  103.                         },
  104.                 },
  105.                 {
  106.                         name: "createrawtransaction - no inputs",
  107.                         newCmd: func() (interface{}, error) {
  108. -                               return btcjson.NewCmd("createrawtransaction", `[]`, `{"456":"0.0123"}`)
  109. +                               return btcjson.NewCmd("createrawtransaction", `[]`, `{"456":0.0123}`)
  110.                         },
  111.                         staticCmd: func() interface{} {
  112. -                               amounts := map[string]decimal.Decimal{"456": decimal.NewFromFloat(.0123)}
  113. +                               amounts := map[string]float64{"456": .0123}
  114.                                 return btcjson.NewCreateRawTransactionCmd(nil, amounts, nil)
  115.                         },
  116. -                       marshalled: `{"jsonrpc":"1.0","method":"createrawtransaction","params":[[],{"456":"0.0123"}],"id":1}`,
  117. +                       marshalled: `{"jsonrpc":"1.0","method":"createrawtransaction","params":[[],{"456":0.0123}],"id":1}`,
  118.                         unmarshalled: &btcjson.CreateRawTransactionCmd{
  119.                                 Inputs:  []btcjson.TransactionInput{},
  120. -                               Amounts: map[string]decimal.Decimal{"456": decimal.NewFromFloat(.0123)},
  121. +                               Amounts: map[string]float64{"456": .0123},
  122.                         },
  123.                 },
  124.                 {
  125. @@ -87,13 +86,13 @@ func TestChainSvrCmds(t *testing.T) {
  126.                                 txInputs := []btcjson.TransactionInput{
  127.                                         {Txid: "123", Vout: 1},
  128.                                 }
  129. -                               amounts := map[string]decimal.Decimal{"456": decimal.NewFromFloat(.0123)}
  130. +                               amounts := map[string]float64{"456": .0123}
  131.                                 return btcjson.NewCreateRawTransactionCmd(txInputs, amounts, btcjson.Int64(12312333333))
  132.                         },
  133. -                       marshalled: `{"jsonrpc":"1.0","method":"createrawtransaction","params":[[{"txid":"123","vout":1}],{"456":"0.0123"},12312333333],"id":1}`,
  134. +                       marshalled: `{"jsonrpc":"1.0","method":"createrawtransaction","params":[[{"txid":"123","vout":1}],{"456":0.0123},12312333333],"id":1}`,
  135.                         unmarshalled: &btcjson.CreateRawTransactionCmd{
  136.                                 Inputs:   []btcjson.TransactionInput{{Txid: "123", Vout: 1}},
  137. -                               Amounts:  map[string]decimal.Decimal{"456": decimal.NewFromFloat(.0123)},
  138. +                               Amounts:  map[string]float64{"456": .0123},
  139.                                 LockTime: btcjson.Int64(12312333333),
  140.                         },
  141.                 },
  142. diff --git a/btcjson/chainsvrresults.go b/btcjson/chainsvrresults.go
  143. index 011fa1c1..3759eb0c 100644
  144. --- a/btcjson/chainsvrresults.go
  145. +++ b/btcjson/chainsvrresults.go
  146. @@ -438,7 +438,6 @@ type GetTxOutResult struct {
  147.         BestBlock     string             `json:"bestblock"`
  148.         Confirmations int64              `json:"confirmations"`
  149.         Value         float64            `json:"value"`
  150. -       Amount        monautil.Amount    `json:"amount"`
  151.         ScriptPubKey  ScriptPubKeyResult `json:"scriptPubKey"`
  152.         Coinbase      bool               `json:"coinbase"`
  153.  }
  154. @@ -529,9 +528,8 @@ func (v *Vin) MarshalJSON() ([]byte, error) {
  155.  
  156.  // PrevOut represents previous output for an input Vin.
  157.  type PrevOut struct {
  158. -       Addresses []string        `json:"addresses,omitempty"`
  159. -       Value     float64         `json:"value"`
  160. -       Amount    monautil.Amount `json:"amount"`
  161. +       Addresses []string `json:"addresses,omitempty"`
  162. +       Value     float64  `json:"value"`
  163.  }
  164.  
  165.  // VinPrevOut is like Vin except it includes PrevOut.  It is used by searchrawtransaction
  166. @@ -608,7 +606,6 @@ func (v *VinPrevOut) MarshalJSON() ([]byte, error) {
  167.  // getrawtransaction and decoderawtransaction use the same structure.
  168.  type Vout struct {
  169.         Value        float64            `json:"value"`
  170. -       Amount       monautil.Amount    `json:"amount"`
  171.         N            uint32             `json:"n"`
  172.         ScriptPubKey ScriptPubKeyResult `json:"scriptPubKey"`
  173.  }
  174. diff --git a/btcjson/chainsvrresults_test.go b/btcjson/chainsvrresults_test.go
  175. index 805e9408..23884ab2 100644
  176. --- a/btcjson/chainsvrresults_test.go
  177. +++ b/btcjson/chainsvrresults_test.go
  178. @@ -66,7 +66,7 @@ func TestChainSvrCustomResults(t *testing.T) {
  179.                                 },
  180.                                 Sequence: 4294967295,
  181.                         },
  182. -                       expected: `{"txid":"123","vout":1,"scriptSig":{"asm":"0","hex":"00"},"prevOut":{"addresses":["addr1"],"value":0,"amount":0},"sequence":4294967295}`,
  183. +                       expected: `{"txid":"123","vout":1,"scriptSig":{"asm":"0","hex":"00"},"prevOut":{"addresses":["addr1"],"value":0},"sequence":4294967295}`,
  184.                 },
  185.         }
  186.  
  187. diff --git a/btcjson/chainsvrwsntfns.go b/btcjson/chainsvrwsntfns.go
  188. index 053ddd78..58b7a544 100644
  189. --- a/btcjson/chainsvrwsntfns.go
  190. +++ b/btcjson/chainsvrwsntfns.go
  191. @@ -8,8 +8,6 @@
  192.  
  193.  package btcjson
  194.  
  195. -import "github.com/shopspring/decimal"
  196. -
  197.  const (
  198.         // BlockConnectedNtfnMethod is the legacy, deprecated method used for
  199.         // notifications from the chain server that a block has been connected.
  200. @@ -250,12 +248,12 @@ func NewRescanProgressNtfn(hash string, height int32, time int64) *RescanProgres
  201.  // TxAcceptedNtfn defines the txaccepted JSON-RPC notification.
  202.  type TxAcceptedNtfn struct {
  203.         TxID   string
  204. -       Amount decimal.Decimal
  205. +       Amount float64
  206.  }
  207.  
  208.  // NewTxAcceptedNtfn returns a new instance which can be used to issue a
  209.  // txaccepted JSON-RPC notification.
  210. -func NewTxAcceptedNtfn(txHash string, amount decimal.Decimal) *TxAcceptedNtfn {
  211. +func NewTxAcceptedNtfn(txHash string, amount float64) *TxAcceptedNtfn {
  212.         return &TxAcceptedNtfn{
  213.                 TxID:   txHash,
  214.                 Amount: amount,
  215. diff --git a/btcjson/chainsvrwsntfns_test.go b/btcjson/chainsvrwsntfns_test.go
  216. index be47b144..223dfbc8 100644
  217. --- a/btcjson/chainsvrwsntfns_test.go
  218. +++ b/btcjson/chainsvrwsntfns_test.go
  219. @@ -13,7 +13,6 @@ import (
  220.         "testing"
  221.  
  222.         "github.com/monasuite/monad/btcjson"
  223. -       "github.com/shopspring/decimal"
  224.  )
  225.  
  226.  // TestChainSvrWsNtfns tests all of the chain server websocket-specific
  227. @@ -172,15 +171,15 @@ func TestChainSvrWsNtfns(t *testing.T) {
  228.                 {
  229.                         name: "txaccepted",
  230.                         newNtfn: func() (interface{}, error) {
  231. -                               return btcjson.NewCmd("txaccepted", "123", decimal.NewFromFloat(1.5))
  232. +                               return btcjson.NewCmd("txaccepted", "123", 1.5)
  233.                         },
  234.                         staticNtfn: func() interface{} {
  235. -                               return btcjson.NewTxAcceptedNtfn("123", decimal.NewFromFloat(1.5))
  236. +                               return btcjson.NewTxAcceptedNtfn("123", 1.5)
  237.                         },
  238. -                       marshalled: `{"jsonrpc":"1.0","method":"txaccepted","params":["123","1.5"],"id":null}`,
  239. +                       marshalled: `{"jsonrpc":"1.0","method":"txaccepted","params":["123",1.5],"id":null}`,
  240.                         unmarshalled: &btcjson.TxAcceptedNtfn{
  241.                                 TxID:   "123",
  242. -                               Amount: decimal.NewFromFloat(1.5),
  243. +                               Amount: 1.5,
  244.                         },
  245.                 },
  246.                 {
  247. diff --git a/btcjson/cmdinfo.go b/btcjson/cmdinfo.go
  248. index cbcb844a..1e78e286 100644
  249. --- a/btcjson/cmdinfo.go
  250. +++ b/btcjson/cmdinfo.go
  251. @@ -72,8 +72,6 @@ func subStructUsage(structType reflect.Type) string {
  252.                 fieldValue := fieldName
  253.                 fieldKind := rtf.Type.Kind()
  254.                 switch {
  255. -               case fieldKind.String() == "decimal.Decimal":
  256. -                       fieldValue = "n.nnn"
  257.                 case isNumeric(fieldKind):
  258.                         if fieldKind == reflect.Float32 || fieldKind == reflect.Float64 {
  259.                                 fieldValue = "n.nnn"
  260. @@ -152,9 +150,6 @@ func fieldUsage(structField reflect.StructField, defaultVal *reflect.Value) stri
  261.  
  262.         // Handle certain types uniquely to provide nicer usage.
  263.         fieldName := strings.ToLower(structField.Name)
  264. -       if fieldType.String() == "decimal.Decimal" {
  265. -               return fieldName
  266. -       }
  267.         switch fieldType.Kind() {
  268.         case reflect.String:
  269.                 if defaultVal != nil {
  270. diff --git a/btcjson/help.go b/btcjson/help.go
  271. index 2a7e11a0..f502d09f 100644
  272. --- a/btcjson/help.go
  273. +++ b/btcjson/help.go
  274. @@ -48,9 +48,6 @@ type descLookupFunc func(string) string
  275.  // associated with the provided Go type.
  276.  func reflectTypeToJSONType(xT descLookupFunc, rt reflect.Type) string {
  277.         kind := rt.Kind()
  278. -       if rt.String() == "decimal.Decimal" {
  279. -               return xT("json-type-numeric")
  280. -       }
  281.         if isNumeric(kind) {
  282.                 return xT("json-type-numeric")
  283.         }
  284. @@ -148,9 +145,6 @@ func reflectTypeToJSONExample(xT descLookupFunc, rt reflect.Type, indentLevel in
  285.         if rt.Kind() == reflect.Ptr {
  286.                 rt = rt.Elem()
  287.         }
  288. -       if rt.String() == "decimal.Decimal" {
  289. -               return []string{"n.nnn"}, false
  290. -       }
  291.         kind := rt.Kind()
  292.         if isNumeric(kind) {
  293.                 if kind == reflect.Float32 || kind == reflect.Float64 {
  294. @@ -338,6 +332,7 @@ func argHelp(xT descLookupFunc, rtp reflect.Type, defaults map[int]reflect.Value
  295.         if numFields == 0 {
  296.                 return ""
  297.         }
  298. +
  299.         // Generate the help for each argument in the command.  Several
  300.         // simplifying assumptions are made here because the RegisterCmd
  301.         // function has already rigorously enforced the layout.
  302. @@ -348,11 +343,13 @@ func argHelp(xT descLookupFunc, rtp reflect.Type, defaults map[int]reflect.Value
  303.                 if defVal, ok := defaults[i]; ok {
  304.                         defaultVal = &defVal
  305.                 }
  306. +
  307.                 fieldName := strings.ToLower(rtf.Name)
  308.                 helpText := fmt.Sprintf("%d.\t%s\t(%s)\t%s", i+1, fieldName,
  309.                         argTypeHelp(xT, rtf, defaultVal),
  310.                         xT(method+"-"+fieldName))
  311.                 args = append(args, helpText)
  312. +
  313.                 // For types which require a JSON object, or an array of JSON
  314.                 // objects, generate the full syntax for the argument.
  315.                 fieldType := rtf.Type
  316. @@ -362,11 +359,9 @@ func argHelp(xT descLookupFunc, rtp reflect.Type, defaults map[int]reflect.Value
  317.                 kind := fieldType.Kind()
  318.                 switch kind {
  319.                 case reflect.Struct:
  320. -                       if fieldType.String() != "decimal.Decimal" {
  321. -                               fieldDescKey := fmt.Sprintf("%s-%s", method, fieldName)
  322. -                               resultText := resultTypeHelp(xT, fieldType, fieldDescKey)
  323. -                               args = append(args, resultText)
  324. -                       }
  325. +                       fieldDescKey := fmt.Sprintf("%s-%s", method, fieldName)
  326. +                       resultText := resultTypeHelp(xT, fieldType, fieldDescKey)
  327. +                       args = append(args, resultText)
  328.  
  329.                 case reflect.Map:
  330.                         fieldDescKey := fmt.Sprintf("%s-%s", method, fieldName)
  331. @@ -451,9 +446,6 @@ func isValidResultType(kind reflect.Kind) bool {
  332.         if isNumeric(kind) {
  333.                 return true
  334.         }
  335. -       if kind.String() == "decimal.Decimal" {
  336. -               return true
  337. -       }
  338.  
  339.         switch kind {
  340.         case reflect.String, reflect.Struct, reflect.Array, reflect.Slice,
  341. @@ -558,6 +550,7 @@ func GenerateHelp(method string, descs map[string]string, resultTypes ...interfa
  342.                 missingKey = key
  343.                 return key
  344.         }
  345. +
  346.         // Generate and return the help for the method.
  347.         help := methodHelp(xT, rtp, info.defaults, method, resultTypes)
  348.         if missingKey != "" {
  349. diff --git a/btcjson/helpers.go b/btcjson/helpers.go
  350. index 90fe1fbe..eda26cb8 100644
  351. --- a/btcjson/helpers.go
  352. +++ b/btcjson/helpers.go
  353. @@ -4,8 +4,6 @@
  354.  
  355.  package btcjson
  356.  
  357. -import "github.com/shopspring/decimal"
  358. -
  359.  // Bool is a helper routine that allocates a new bool value to store v and
  360.  // returns a pointer to it.  This is useful when assigning optional parameters.
  361.  func Bool(v bool) *bool {
  362. @@ -78,14 +76,6 @@ func String(v string) *string {
  363.         return p
  364.  }
  365.  
  366. -// Decimal is a helper routine that allocates a new decimal.Decimal value to store v and
  367. -// returns a pointer to it.  This is useful when assigning optional parameters.
  368. -func Decimal(v decimal.Decimal) *decimal.Decimal {
  369. -       p := new(decimal.Decimal)
  370. -       *p = v
  371. -       return p
  372. -}
  373. -
  374.  // NewFilterTypeName is a helper routine that allocates a new FilterTypeName value to store v and
  375.  // returns a pointer to it.  This is useful when assigning optional parameters.
  376.  func NewFilterTypeName(v FilterTypeName) *FilterTypeName {
  377. diff --git a/btcjson/helpers_test.go b/btcjson/helpers_test.go
  378. index 45221a71..61a5de14 100644
  379. --- a/btcjson/helpers_test.go
  380. +++ b/btcjson/helpers_test.go
  381. @@ -9,7 +9,6 @@ import (
  382.         "testing"
  383.  
  384.         "github.com/monasuite/monad/btcjson"
  385. -       "github.com/shopspring/decimal"
  386.  )
  387.  
  388.  // TestHelpers tests the various helper functions which create pointers to
  389. @@ -102,16 +101,6 @@ func TestHelpers(t *testing.T) {
  390.                                 return &val
  391.                         }(),
  392.                 },
  393. -               {
  394. -                       name: "decimal",
  395. -                       f: func() interface{} {
  396. -                               return btcjson.Decimal(decimal.NewFromFloat(0.0001))
  397. -                       },
  398. -                       expected: func() interface{} {
  399. -                               val := decimal.NewFromFloat(0.0001)
  400. -                               return &val
  401. -                       }(),
  402. -               },
  403.         }
  404.  
  405.         t.Logf("Running %d tests", len(tests))
  406. diff --git a/btcjson/walletsvrcmds.go b/btcjson/walletsvrcmds.go
  407. index 8f783d5b..a2c73988 100644
  408. --- a/btcjson/walletsvrcmds.go
  409. +++ b/btcjson/walletsvrcmds.go
  410. @@ -10,8 +10,6 @@ package btcjson
  411.  import (
  412.         "encoding/json"
  413.         "fmt"
  414. -
  415. -       "github.com/shopspring/decimal"
  416.  )
  417.  
  418.  // AddMultisigAddressCmd defines the addmutisigaddress JSON-RPC command.
  419. @@ -490,8 +488,8 @@ func NewLockUnspentCmd(unlock bool, transactions []TransactionInput) *LockUnspen
  420.  type MoveCmd struct {
  421.         FromAccount string
  422.         ToAccount   string
  423. -       Amount      decimal.Decimal // In BTC
  424. -       MinConf     *int            `jsonrpcdefault:"1"`
  425. +       Amount      float64 // In BTC
  426. +       MinConf     *int    `jsonrpcdefault:"1"`
  427.         Comment     *string
  428.  }
  429.  
  430. @@ -500,7 +498,7 @@ type MoveCmd struct {
  431.  //
  432.  // The parameters which are pointers indicate they are optional.  Passing nil
  433.  // for optional parameters will use the default value.
  434. -func NewMoveCmd(fromAccount, toAccount string, amount decimal.Decimal, minConf *int, comment *string) *MoveCmd {
  435. +func NewMoveCmd(fromAccount, toAccount string, amount float64, minConf *int, comment *string) *MoveCmd {
  436.         return &MoveCmd{
  437.                 FromAccount: fromAccount,
  438.                 ToAccount:   toAccount,
  439. @@ -514,8 +512,8 @@ func NewMoveCmd(fromAccount, toAccount string, amount decimal.Decimal, minConf *
  440.  type SendFromCmd struct {
  441.         FromAccount string
  442.         ToAddress   string
  443. -       Amount      decimal.Decimal // In BTC
  444. -       MinConf     *int            `jsonrpcdefault:"1"`
  445. +       Amount      float64 // In BTC
  446. +       MinConf     *int    `jsonrpcdefault:"1"`
  447.         Comment     *string
  448.         CommentTo   *string
  449.  }
  450. @@ -525,7 +523,7 @@ type SendFromCmd struct {
  451.  //
  452.  // The parameters which are pointers indicate they are optional.  Passing nil
  453.  // for optional parameters will use the default value.
  454. -func NewSendFromCmd(fromAccount, toAddress string, amount decimal.Decimal, minConf *int, comment, commentTo *string) *SendFromCmd {
  455. +func NewSendFromCmd(fromAccount, toAddress string, amount float64, minConf *int, comment, commentTo *string) *SendFromCmd {
  456.         return &SendFromCmd{
  457.                 FromAccount: fromAccount,
  458.                 ToAddress:   toAddress,
  459. @@ -539,8 +537,8 @@ func NewSendFromCmd(fromAccount, toAddress string, amount decimal.Decimal, minCo
  460.  // SendManyCmd defines the sendmany JSON-RPC command.
  461.  type SendManyCmd struct {
  462.         FromAccount string
  463. -       Amounts     map[string]decimal.Decimal `jsonrpcusage:"{\"address\":amount,...}"` // In BTC
  464. -       MinConf     *int                       `jsonrpcdefault:"1"`
  465. +       Amounts     map[string]float64 `jsonrpcusage:"{\"address\":amount,...}"` // In BTC
  466. +       MinConf     *int               `jsonrpcdefault:"1"`
  467.         Comment     *string
  468.  }
  469.  
  470. @@ -549,7 +547,7 @@ type SendManyCmd struct {
  471.  //
  472.  // The parameters which are pointers indicate they are optional.  Passing nil
  473.  // for optional parameters will use the default value.
  474. -func NewSendManyCmd(fromAccount string, amounts map[string]decimal.Decimal, minConf *int, comment *string) *SendManyCmd {
  475. +func NewSendManyCmd(fromAccount string, amounts map[string]float64, minConf *int, comment *string) *SendManyCmd {
  476.         return &SendManyCmd{
  477.                 FromAccount: fromAccount,
  478.                 Amounts:     amounts,
  479. @@ -561,7 +559,7 @@ func NewSendManyCmd(fromAccount string, amounts map[string]decimal.Decimal, minC
  480.  // SendToAddressCmd defines the sendtoaddress JSON-RPC command.
  481.  type SendToAddressCmd struct {
  482.         Address   string
  483. -       Amount    decimal.Decimal
  484. +       Amount    float64
  485.         Comment   *string
  486.         CommentTo *string
  487.  }
  488. @@ -571,7 +569,7 @@ type SendToAddressCmd struct {
  489.  //
  490.  // The parameters which are pointers indicate they are optional.  Passing nil
  491.  // for optional parameters will use the default value.
  492. -func NewSendToAddressCmd(address string, amount decimal.Decimal, comment, commentTo *string) *SendToAddressCmd {
  493. +func NewSendToAddressCmd(address string, amount float64, comment, commentTo *string) *SendToAddressCmd {
  494.         return &SendToAddressCmd{
  495.                 Address:   address,
  496.                 Amount:    amount,
  497. @@ -597,12 +595,12 @@ func NewSetAccountCmd(address, account string) *SetAccountCmd {
  498.  
  499.  // SetTxFeeCmd defines the settxfee JSON-RPC command.
  500.  type SetTxFeeCmd struct {
  501. -       Amount decimal.Decimal // In BTC
  502. +       Amount float64 // In BTC
  503.  }
  504.  
  505.  // NewSetTxFeeCmd returns a new instance which can be used to issue a settxfee
  506.  // JSON-RPC command.
  507. -func NewSetTxFeeCmd(amount decimal.Decimal) *SetTxFeeCmd {
  508. +func NewSetTxFeeCmd(amount float64) *SetTxFeeCmd {
  509.         return &SetTxFeeCmd{
  510.                 Amount: amount,
  511.         }
  512. diff --git a/btcjson/walletsvrcmds_test.go b/btcjson/walletsvrcmds_test.go
  513. index 8ae33540..f4b8100f 100644
  514. --- a/btcjson/walletsvrcmds_test.go
  515. +++ b/btcjson/walletsvrcmds_test.go
  516. @@ -12,7 +12,6 @@ import (
  517.         "testing"
  518.  
  519.         "github.com/monasuite/monad/btcjson"
  520. -       "github.com/shopspring/decimal"
  521.  )
  522.  
  523.  // TestWalletSvrCmds tests all of the wallet server commands marshal and
  524. @@ -873,16 +872,16 @@ func TestWalletSvrCmds(t *testing.T) {
  525.                 {
  526.                         name: "move",
  527.                         newCmd: func() (interface{}, error) {
  528. -                               return btcjson.NewCmd("move", "from", "to", decimal.NewFromFloat(0.5))
  529. +                               return btcjson.NewCmd("move", "from", "to", 0.5)
  530.                         },
  531.                         staticCmd: func() interface{} {
  532. -                               return btcjson.NewMoveCmd("from", "to", decimal.NewFromFloat(0.5), nil, nil)
  533. +                               return btcjson.NewMoveCmd("from", "to", 0.5, nil, nil)
  534.                         },
  535. -                       marshalled: `{"jsonrpc":"1.0","method":"move","params":["from","to","0.5"],"id":1}`,
  536. +                       marshalled: `{"jsonrpc":"1.0","method":"move","params":["from","to",0.5],"id":1}`,
  537.                         unmarshalled: &btcjson.MoveCmd{
  538.                                 FromAccount: "from",
  539.                                 ToAccount:   "to",
  540. -                               Amount:      decimal.NewFromFloat(0.5),
  541. +                               Amount:      0.5,
  542.                                 MinConf:     btcjson.Int(1),
  543.                                 Comment:     nil,
  544.                         },
  545. @@ -890,16 +889,16 @@ func TestWalletSvrCmds(t *testing.T) {
  546.                 {
  547.                         name: "move optional1",
  548.                         newCmd: func() (interface{}, error) {
  549. -                               return btcjson.NewCmd("move", "from", "to", decimal.NewFromFloat(0.5), 6)
  550. +                               return btcjson.NewCmd("move", "from", "to", 0.5, 6)
  551.                         },
  552.                         staticCmd: func() interface{} {
  553. -                               return btcjson.NewMoveCmd("from", "to", decimal.NewFromFloat(0.5), btcjson.Int(6), nil)
  554. +                               return btcjson.NewMoveCmd("from", "to", 0.5, btcjson.Int(6), nil)
  555.                         },
  556. -                       marshalled: `{"jsonrpc":"1.0","method":"move","params":["from","to","0.5",6],"id":1}`,
  557. +                       marshalled: `{"jsonrpc":"1.0","method":"move","params":["from","to",0.5,6],"id":1}`,
  558.                         unmarshalled: &btcjson.MoveCmd{
  559.                                 FromAccount: "from",
  560.                                 ToAccount:   "to",
  561. -                               Amount:      decimal.NewFromFloat(0.5),
  562. +                               Amount:      0.5,
  563.                                 MinConf:     btcjson.Int(6),
  564.                                 Comment:     nil,
  565.                         },
  566. @@ -907,16 +906,16 @@ func TestWalletSvrCmds(t *testing.T) {
  567.                 {
  568.                         name: "move optional2",
  569.                         newCmd: func() (interface{}, error) {
  570. -                               return btcjson.NewCmd("move", "from", "to", decimal.NewFromFloat(0.5), 6, "comment")
  571. +                               return btcjson.NewCmd("move", "from", "to", 0.5, 6, "comment")
  572.                         },
  573.                         staticCmd: func() interface{} {
  574. -                               return btcjson.NewMoveCmd("from", "to", decimal.NewFromFloat(0.5), btcjson.Int(6), btcjson.String("comment"))
  575. +                               return btcjson.NewMoveCmd("from", "to", 0.5, btcjson.Int(6), btcjson.String("comment"))
  576.                         },
  577. -                       marshalled: `{"jsonrpc":"1.0","method":"move","params":["from","to","0.5",6,"comment"],"id":1}`,
  578. +                       marshalled: `{"jsonrpc":"1.0","method":"move","params":["from","to",0.5,6,"comment"],"id":1}`,
  579.                         unmarshalled: &btcjson.MoveCmd{
  580.                                 FromAccount: "from",
  581.                                 ToAccount:   "to",
  582. -                               Amount:      decimal.NewFromFloat(0.5),
  583. +                               Amount:      0.5,
  584.                                 MinConf:     btcjson.Int(6),
  585.                                 Comment:     btcjson.String("comment"),
  586.                         },
  587. @@ -924,16 +923,16 @@ func TestWalletSvrCmds(t *testing.T) {
  588.                 {
  589.                         name: "sendfrom",
  590.                         newCmd: func() (interface{}, error) {
  591. -                               return btcjson.NewCmd("sendfrom", "from", "1Address", decimal.NewFromFloat(0.5))
  592. +                               return btcjson.NewCmd("sendfrom", "from", "1Address", 0.5)
  593.                         },
  594.                         staticCmd: func() interface{} {
  595. -                               return btcjson.NewSendFromCmd("from", "1Address", decimal.NewFromFloat(0.5), nil, nil, nil)
  596. +                               return btcjson.NewSendFromCmd("from", "1Address", 0.5, nil, nil, nil)
  597.                         },
  598. -                       marshalled: `{"jsonrpc":"1.0","method":"sendfrom","params":["from","1Address","0.5"],"id":1}`,
  599. +                       marshalled: `{"jsonrpc":"1.0","method":"sendfrom","params":["from","1Address",0.5],"id":1}`,
  600.                         unmarshalled: &btcjson.SendFromCmd{
  601.                                 FromAccount: "from",
  602.                                 ToAddress:   "1Address",
  603. -                               Amount:      decimal.NewFromFloat(0.5),
  604. +                               Amount:      0.5,
  605.                                 MinConf:     btcjson.Int(1),
  606.                                 Comment:     nil,
  607.                                 CommentTo:   nil,
  608. @@ -942,16 +941,16 @@ func TestWalletSvrCmds(t *testing.T) {
  609.                 {
  610.                         name: "sendfrom optional1",
  611.                         newCmd: func() (interface{}, error) {
  612. -                               return btcjson.NewCmd("sendfrom", "from", "1Address", decimal.NewFromFloat(0.5), 6)
  613. +                               return btcjson.NewCmd("sendfrom", "from", "1Address", 0.5, 6)
  614.                         },
  615.                         staticCmd: func() interface{} {
  616. -                               return btcjson.NewSendFromCmd("from", "1Address", decimal.NewFromFloat(0.5), btcjson.Int(6), nil, nil)
  617. +                               return btcjson.NewSendFromCmd("from", "1Address", 0.5, btcjson.Int(6), nil, nil)
  618.                         },
  619. -                       marshalled: `{"jsonrpc":"1.0","method":"sendfrom","params":["from","1Address","0.5",6],"id":1}`,
  620. +                       marshalled: `{"jsonrpc":"1.0","method":"sendfrom","params":["from","1Address",0.5,6],"id":1}`,
  621.                         unmarshalled: &btcjson.SendFromCmd{
  622.                                 FromAccount: "from",
  623.                                 ToAddress:   "1Address",
  624. -                               Amount:      decimal.NewFromFloat(0.5),
  625. +                               Amount:      0.5,
  626.                                 MinConf:     btcjson.Int(6),
  627.                                 Comment:     nil,
  628.                                 CommentTo:   nil,
  629. @@ -960,17 +959,17 @@ func TestWalletSvrCmds(t *testing.T) {
  630.                 {
  631.                         name: "sendfrom optional2",
  632.                         newCmd: func() (interface{}, error) {
  633. -                               return btcjson.NewCmd("sendfrom", "from", "1Address", decimal.NewFromFloat(0.5), 6, "comment")
  634. +                               return btcjson.NewCmd("sendfrom", "from", "1Address", 0.5, 6, "comment")
  635.                         },
  636.                         staticCmd: func() interface{} {
  637. -                               return btcjson.NewSendFromCmd("from", "1Address", decimal.NewFromFloat(0.5), btcjson.Int(6),
  638. +                               return btcjson.NewSendFromCmd("from", "1Address", 0.5, btcjson.Int(6),
  639.                                         btcjson.String("comment"), nil)
  640.                         },
  641. -                       marshalled: `{"jsonrpc":"1.0","method":"sendfrom","params":["from","1Address","0.5",6,"comment"],"id":1}`,
  642. +                       marshalled: `{"jsonrpc":"1.0","method":"sendfrom","params":["from","1Address",0.5,6,"comment"],"id":1}`,
  643.                         unmarshalled: &btcjson.SendFromCmd{
  644.                                 FromAccount: "from",
  645.                                 ToAddress:   "1Address",
  646. -                               Amount:      decimal.NewFromFloat(0.5),
  647. +                               Amount:      0.5,
  648.                                 MinConf:     btcjson.Int(6),
  649.                                 Comment:     btcjson.String("comment"),
  650.                                 CommentTo:   nil,
  651. @@ -979,17 +978,17 @@ func TestWalletSvrCmds(t *testing.T) {
  652.                 {
  653.                         name: "sendfrom optional3",
  654.                         newCmd: func() (interface{}, error) {
  655. -                               return btcjson.NewCmd("sendfrom", "from", "1Address", decimal.NewFromFloat(0.5), 6, "comment", "commentto")
  656. +                               return btcjson.NewCmd("sendfrom", "from", "1Address", 0.5, 6, "comment", "commentto")
  657.                         },
  658.                         staticCmd: func() interface{} {
  659. -                               return btcjson.NewSendFromCmd("from", "1Address", decimal.NewFromFloat(0.5), btcjson.Int(6),
  660. +                               return btcjson.NewSendFromCmd("from", "1Address", 0.5, btcjson.Int(6),
  661.                                         btcjson.String("comment"), btcjson.String("commentto"))
  662.                         },
  663. -                       marshalled: `{"jsonrpc":"1.0","method":"sendfrom","params":["from","1Address","0.5",6,"comment","commentto"],"id":1}`,
  664. +                       marshalled: `{"jsonrpc":"1.0","method":"sendfrom","params":["from","1Address",0.5,6,"comment","commentto"],"id":1}`,
  665.                         unmarshalled: &btcjson.SendFromCmd{
  666.                                 FromAccount: "from",
  667.                                 ToAddress:   "1Address",
  668. -                               Amount:      decimal.NewFromFloat(0.5),
  669. +                               Amount:      0.5,
  670.                                 MinConf:     btcjson.Int(6),
  671.                                 Comment:     btcjson.String("comment"),
  672.                                 CommentTo:   btcjson.String("commentto"),
  673. @@ -1001,13 +1000,13 @@ func TestWalletSvrCmds(t *testing.T) {
  674.                                 return btcjson.NewCmd("sendmany", "from", `{"1Address":0.5}`)
  675.                         },
  676.                         staticCmd: func() interface{} {
  677. -                               amounts := map[string]decimal.Decimal{"1Address": decimal.NewFromFloat(0.5)}
  678. +                               amounts := map[string]float64{"1Address": 0.5}
  679.                                 return btcjson.NewSendManyCmd("from", amounts, nil, nil)
  680.                         },
  681. -                       marshalled: `{"jsonrpc":"1.0","method":"sendmany","params":["from",{"1Address":"0.5"}],"id":1}`,
  682. +                       marshalled: `{"jsonrpc":"1.0","method":"sendmany","params":["from",{"1Address":0.5}],"id":1}`,
  683.                         unmarshalled: &btcjson.SendManyCmd{
  684.                                 FromAccount: "from",
  685. -                               Amounts:     map[string]decimal.Decimal{"1Address": decimal.NewFromFloat(0.5)},
  686. +                               Amounts:     map[string]float64{"1Address": 0.5},
  687.                                 MinConf:     btcjson.Int(1),
  688.                                 Comment:     nil,
  689.                         },
  690. @@ -1018,13 +1017,13 @@ func TestWalletSvrCmds(t *testing.T) {
  691.                                 return btcjson.NewCmd("sendmany", "from", `{"1Address":0.5}`, 6)
  692.                         },
  693.                         staticCmd: func() interface{} {
  694. -                               amounts := map[string]decimal.Decimal{"1Address": decimal.NewFromFloat(0.5)}
  695. +                               amounts := map[string]float64{"1Address": 0.5}
  696.                                 return btcjson.NewSendManyCmd("from", amounts, btcjson.Int(6), nil)
  697.                         },
  698. -                       marshalled: `{"jsonrpc":"1.0","method":"sendmany","params":["from",{"1Address":"0.5"},6],"id":1}`,
  699. +                       marshalled: `{"jsonrpc":"1.0","method":"sendmany","params":["from",{"1Address":0.5},6],"id":1}`,
  700.                         unmarshalled: &btcjson.SendManyCmd{
  701.                                 FromAccount: "from",
  702. -                               Amounts:     map[string]decimal.Decimal{"1Address": decimal.NewFromFloat(0.5)},
  703. +                               Amounts:     map[string]float64{"1Address": 0.5},
  704.                                 MinConf:     btcjson.Int(6),
  705.                                 Comment:     nil,
  706.                         },
  707. @@ -1035,13 +1034,13 @@ func TestWalletSvrCmds(t *testing.T) {
  708.                                 return btcjson.NewCmd("sendmany", "from", `{"1Address":0.5}`, 6, "comment")
  709.                         },
  710.                         staticCmd: func() interface{} {
  711. -                               amounts := map[string]decimal.Decimal{"1Address": decimal.NewFromFloat(0.5)}
  712. +                               amounts := map[string]float64{"1Address": 0.5}
  713.                                 return btcjson.NewSendManyCmd("from", amounts, btcjson.Int(6), btcjson.String("comment"))
  714.                         },
  715. -                       marshalled: `{"jsonrpc":"1.0","method":"sendmany","params":["from",{"1Address":"0.5"},6,"comment"],"id":1}`,
  716. +                       marshalled: `{"jsonrpc":"1.0","method":"sendmany","params":["from",{"1Address":0.5},6,"comment"],"id":1}`,
  717.                         unmarshalled: &btcjson.SendManyCmd{
  718.                                 FromAccount: "from",
  719. -                               Amounts:     map[string]decimal.Decimal{"1Address": decimal.NewFromFloat(0.5)},
  720. +                               Amounts:     map[string]float64{"1Address": 0.5},
  721.                                 MinConf:     btcjson.Int(6),
  722.                                 Comment:     btcjson.String("comment"),
  723.                         },
  724. @@ -1049,15 +1048,15 @@ func TestWalletSvrCmds(t *testing.T) {
  725.                 {
  726.                         name: "sendtoaddress",
  727.                         newCmd: func() (interface{}, error) {
  728. -                               return btcjson.NewCmd("sendtoaddress", "1Address", decimal.NewFromFloat(0.5))
  729. +                               return btcjson.NewCmd("sendtoaddress", "1Address", 0.5)
  730.                         },
  731.                         staticCmd: func() interface{} {
  732. -                               return btcjson.NewSendToAddressCmd("1Address", decimal.NewFromFloat(0.5), nil, nil)
  733. +                               return btcjson.NewSendToAddressCmd("1Address", 0.5, nil, nil)
  734.                         },
  735. -                       marshalled: `{"jsonrpc":"1.0","method":"sendtoaddress","params":["1Address","0.5"],"id":1}`,
  736. +                       marshalled: `{"jsonrpc":"1.0","method":"sendtoaddress","params":["1Address",0.5],"id":1}`,
  737.                         unmarshalled: &btcjson.SendToAddressCmd{
  738.                                 Address:   "1Address",
  739. -                               Amount:    decimal.NewFromFloat(0.5),
  740. +                               Amount:    0.5,
  741.                                 Comment:   nil,
  742.                                 CommentTo: nil,
  743.                         },
  744. @@ -1065,16 +1064,16 @@ func TestWalletSvrCmds(t *testing.T) {
  745.                 {
  746.                         name: "sendtoaddress optional1",
  747.                         newCmd: func() (interface{}, error) {
  748. -                               return btcjson.NewCmd("sendtoaddress", "1Address", decimal.NewFromFloat(0.5), "comment", "commentto")
  749. +                               return btcjson.NewCmd("sendtoaddress", "1Address", 0.5, "comment", "commentto")
  750.                         },
  751.                         staticCmd: func() interface{} {
  752. -                               return btcjson.NewSendToAddressCmd("1Address", decimal.NewFromFloat(0.5), btcjson.String("comment"),
  753. +                               return btcjson.NewSendToAddressCmd("1Address", 0.5, btcjson.String("comment"),
  754.                                         btcjson.String("commentto"))
  755.                         },
  756. -                       marshalled: `{"jsonrpc":"1.0","method":"sendtoaddress","params":["1Address","0.5","comment","commentto"],"id":1}`,
  757. +                       marshalled: `{"jsonrpc":"1.0","method":"sendtoaddress","params":["1Address",0.5,"comment","commentto"],"id":1}`,
  758.                         unmarshalled: &btcjson.SendToAddressCmd{
  759.                                 Address:   "1Address",
  760. -                               Amount:    decimal.NewFromFloat(0.5),
  761. +                               Amount:    0.5,
  762.                                 Comment:   btcjson.String("comment"),
  763.                                 CommentTo: btcjson.String("commentto"),
  764.                         },
  765. @@ -1096,14 +1095,14 @@ func TestWalletSvrCmds(t *testing.T) {
  766.                 {
  767.                         name: "settxfee",
  768.                         newCmd: func() (interface{}, error) {
  769. -                               return btcjson.NewCmd("settxfee", decimal.NewFromFloat(0.0001))
  770. +                               return btcjson.NewCmd("settxfee", 0.0001)
  771.                         },
  772.                         staticCmd: func() interface{} {
  773. -                               return btcjson.NewSetTxFeeCmd(decimal.NewFromFloat(0.0001))
  774. +                               return btcjson.NewSetTxFeeCmd(0.0001)
  775.                         },
  776. -                       marshalled: `{"jsonrpc":"1.0","method":"settxfee","params":["0.0001"],"id":1}`,
  777. +                       marshalled: `{"jsonrpc":"1.0","method":"settxfee","params":[0.0001],"id":1}`,
  778.                         unmarshalled: &btcjson.SetTxFeeCmd{
  779. -                               Amount: decimal.NewFromFloat(0.0001),
  780. +                               Amount: 0.0001,
  781.                         },
  782.                 },
  783.                 {
  784. diff --git a/btcjson/walletsvrresults.go b/btcjson/walletsvrresults.go
  785. index 6ad8ede9..4ad74b1e 100644
  786. --- a/btcjson/walletsvrresults.go
  787. +++ b/btcjson/walletsvrresults.go
  788. @@ -4,28 +4,24 @@
  789.  
  790.  package btcjson
  791.  
  792. -import "github.com/monasuite/monautil"
  793. -
  794.  // GetTransactionDetailsResult models the details data from the gettransaction command.
  795.  //
  796.  // This models the "short" version of the ListTransactionsResult type, which
  797.  // excludes fields common to the transaction.  These common fields are instead
  798.  // part of the GetTransactionResult.
  799.  type GetTransactionDetailsResult struct {
  800. -       Account           string          `json:"account"`
  801. -       Address           string          `json:"address,omitempty"`
  802. -       Amount            float64         `json:"amount"`
  803. -       AmountSatoshi     monautil.Amount `json:"amount"`
  804. -       Category          string          `json:"category"`
  805. -       InvolvesWatchOnly bool            `json:"involveswatchonly,omitempty"`
  806. -       Fee               *float64        `json:"fee,omitempty"`
  807. -       Vout              uint32          `json:"vout"`
  808. +       Account           string   `json:"account"`
  809. +       Address           string   `json:"address,omitempty"`
  810. +       Amount            float64  `json:"amount"`
  811. +       Category          string   `json:"category"`
  812. +       InvolvesWatchOnly bool     `json:"involveswatchonly,omitempty"`
  813. +       Fee               *float64 `json:"fee,omitempty"`
  814. +       Vout              uint32   `json:"vout"`
  815.  }
  816.  
  817.  // GetTransactionResult models the data from the gettransaction command.
  818.  type GetTransactionResult struct {
  819.         Amount          float64                       `json:"amount"`
  820. -       AmountSatoshi   monautil.Amount               `json:"amount"`
  821.         Fee             float64                       `json:"fee,omitempty"`
  822.         Confirmations   int64                         `json:"confirmations"`
  823.         BlockHash       string                        `json:"blockhash"`
  824. @@ -42,72 +38,68 @@ type GetTransactionResult struct {
  825.  // InfoWalletResult models the data returned by the wallet server getinfo
  826.  // command.
  827.  type InfoWalletResult struct {
  828. -       Version         int32           `json:"version"`
  829. -       ProtocolVersion int32           `json:"protocolversion"`
  830. -       WalletVersion   int32           `json:"walletversion"`
  831. -       Balance         float64         `json:"balance"`
  832. -       SatoshiBalance  monautil.Amount `json:"balance"`
  833. -       Blocks          int32           `json:"blocks"`
  834. -       TimeOffset      int64           `json:"timeoffset"`
  835. -       Connections     int32           `json:"connections"`
  836. -       Proxy           string          `json:"proxy"`
  837. -       Difficulty      float64         `json:"difficulty"`
  838. -       TestNet         bool            `json:"testnet"`
  839. -       KeypoolOldest   int64           `json:"keypoololdest"`
  840. -       KeypoolSize     int32           `json:"keypoolsize"`
  841. -       UnlockedUntil   int64           `json:"unlocked_until"`
  842. -       PaytxFee        float64         `json:"paytxfee"`
  843. -       RelayFee        float64         `json:"relayfee"`
  844. -       Errors          string          `json:"errors"`
  845. +       Version         int32   `json:"version"`
  846. +       ProtocolVersion int32   `json:"protocolversion"`
  847. +       WalletVersion   int32   `json:"walletversion"`
  848. +       Balance         float64 `json:"balance"`
  849. +       Blocks          int32   `json:"blocks"`
  850. +       TimeOffset      int64   `json:"timeoffset"`
  851. +       Connections     int32   `json:"connections"`
  852. +       Proxy           string  `json:"proxy"`
  853. +       Difficulty      float64 `json:"difficulty"`
  854. +       TestNet         bool    `json:"testnet"`
  855. +       KeypoolOldest   int64   `json:"keypoololdest"`
  856. +       KeypoolSize     int32   `json:"keypoolsize"`
  857. +       UnlockedUntil   int64   `json:"unlocked_until"`
  858. +       PaytxFee        float64 `json:"paytxfee"`
  859. +       RelayFee        float64 `json:"relayfee"`
  860. +       Errors          string  `json:"errors"`
  861.  }
  862.  
  863.  // ListTransactionsResult models the data from the listtransactions command.
  864.  type ListTransactionsResult struct {
  865. -       Abandoned         bool            `json:"abandoned"`
  866. -       Account           string          `json:"account"`
  867. -       Address           string          `json:"address,omitempty"`
  868. -       Amount            float64         `json:"amount"`
  869. -       AmountSatoshi     monautil.Amount `json:"amount"`
  870. -       BIP125Replaceable string          `json:"bip125-replaceable,omitempty"`
  871. -       BlockHash         string          `json:"blockhash,omitempty"`
  872. -       BlockHeight       *int32          `json:"blockheight,omitempty"`
  873. -       BlockIndex        *int64          `json:"blockindex,omitempty"`
  874. -       BlockTime         int64           `json:"blocktime,omitempty"`
  875. -       Category          string          `json:"category"`
  876. -       Confirmations     int64           `json:"confirmations"`
  877. -       Fee               *float64        `json:"fee,omitempty"`
  878. -       Generated         bool            `json:"generated,omitempty"`
  879. -       InvolvesWatchOnly bool            `json:"involveswatchonly,omitempty"`
  880. -       Label             *string         `json:"label,omitempty"`
  881. -       Time              int64           `json:"time"`
  882. -       TimeReceived      int64           `json:"timereceived"`
  883. -       Trusted           bool            `json:"trusted"`
  884. -       TxID              string          `json:"txid"`
  885. -       Vout              uint32          `json:"vout"`
  886. -       WalletConflicts   []string        `json:"walletconflicts"`
  887. -       Comment           string          `json:"comment,omitempty"`
  888. -       OtherAccount      string          `json:"otheraccount,omitempty"`
  889. +       Abandoned         bool     `json:"abandoned"`
  890. +       Account           string   `json:"account"`
  891. +       Address           string   `json:"address,omitempty"`
  892. +       Amount            float64  `json:"amount"`
  893. +       BIP125Replaceable string   `json:"bip125-replaceable,omitempty"`
  894. +       BlockHash         string   `json:"blockhash,omitempty"`
  895. +       BlockHeight       *int32   `json:"blockheight,omitempty"`
  896. +       BlockIndex        *int64   `json:"blockindex,omitempty"`
  897. +       BlockTime         int64    `json:"blocktime,omitempty"`
  898. +       Category          string   `json:"category"`
  899. +       Confirmations     int64    `json:"confirmations"`
  900. +       Fee               *float64 `json:"fee,omitempty"`
  901. +       Generated         bool     `json:"generated,omitempty"`
  902. +       InvolvesWatchOnly bool     `json:"involveswatchonly,omitempty"`
  903. +       Label             *string  `json:"label,omitempty"`
  904. +       Time              int64    `json:"time"`
  905. +       TimeReceived      int64    `json:"timereceived"`
  906. +       Trusted           bool     `json:"trusted"`
  907. +       TxID              string   `json:"txid"`
  908. +       Vout              uint32   `json:"vout"`
  909. +       WalletConflicts   []string `json:"walletconflicts"`
  910. +       Comment           string   `json:"comment,omitempty"`
  911. +       OtherAccount      string   `json:"otheraccount,omitempty"`
  912.  }
  913.  
  914.  // ListReceivedByAccountResult models the data from the listreceivedbyaccount
  915.  // command.
  916.  type ListReceivedByAccountResult struct {
  917. -       Account       string          `json:"account"`
  918. -       Amount        float64         `json:"amount"`
  919. -       AmountSatoshi monautil.Amount `json:"amount"`
  920. -       Confirmations uint64          `json:"confirmations"`
  921. +       Account       string  `json:"account"`
  922. +       Amount        float64 `json:"amount"`
  923. +       Confirmations uint64  `json:"confirmations"`
  924.  }
  925.  
  926.  // ListReceivedByAddressResult models the data from the listreceivedbyaddress
  927.  // command.
  928.  type ListReceivedByAddressResult struct {
  929. -       Account           string          `json:"account"`
  930. -       Address           string          `json:"address"`
  931. -       Amount            float64         `json:"amount"`
  932. -       AmountSatoshi     monautil.Amount `json:"amount"`
  933. -       Confirmations     uint64          `json:"confirmations"`
  934. -       TxIDs             []string        `json:"txids,omitempty"`
  935. -       InvolvesWatchonly bool            `json:"involvesWatchonly,omitempty"`
  936. +       Account           string   `json:"account"`
  937. +       Address           string   `json:"address"`
  938. +       Amount            float64  `json:"amount"`
  939. +       Confirmations     uint64   `json:"confirmations"`
  940. +       TxIDs             []string `json:"txids,omitempty"`
  941. +       InvolvesWatchonly bool     `json:"involvesWatchonly,omitempty"`
  942.  }
  943.  
  944.  // ListSinceBlockResult models the data from the listsinceblock command.
  945. @@ -118,16 +110,15 @@ type ListSinceBlockResult struct {
  946.  
  947.  // ListUnspentResult models a successful response from the listunspent request.
  948.  type ListUnspentResult struct {
  949. -       TxID          string          `json:"txid"`
  950. -       Vout          uint32          `json:"vout"`
  951. -       Address       string          `json:"address"`
  952. -       Account       string          `json:"account"`
  953. -       ScriptPubKey  string          `json:"scriptPubKey"`
  954. -       RedeemScript  string          `json:"redeemScript,omitempty"`
  955. -       Amount        float64         `json:"amount"`
  956. -       AmountSatoshi monautil.Amount `json:"amount"`
  957. -       Confirmations int64           `json:"confirmations"`
  958. -       Spendable     bool            `json:"spendable"`
  959. +       TxID          string  `json:"txid"`
  960. +       Vout          uint32  `json:"vout"`
  961. +       Address       string  `json:"address"`
  962. +       Account       string  `json:"account"`
  963. +       ScriptPubKey  string  `json:"scriptPubKey"`
  964. +       RedeemScript  string  `json:"redeemScript,omitempty"`
  965. +       Amount        float64 `json:"amount"`
  966. +       Confirmations int64   `json:"confirmations"`
  967. +       Spendable     bool    `json:"spendable"`
  968.  }
  969.  
  970.  // SignRawTransactionError models the data that contains script verification
  971. @@ -173,14 +164,10 @@ type GetBestBlockResult struct {
  972.  
  973.  // BalanceDetailsResult models the details data from the `getbalances` command.
  974.  type BalanceDetailsResult struct {
  975. -       Trusted                 float64          `json:"trusted"`
  976. -       UntrustedPending        float64          `json:"untrusted_pending"`
  977. -       Immature                float64          `json:"immature"`
  978. -       Used                    *float64         `json:"used"`
  979. -       SatsohiTrusted          monautil.Amount  `json:"trusted"`
  980. -       SatoshiUntrustedPending monautil.Amount  `json:"untrusted_pending"`
  981. -       SatoshiImmature         monautil.Amount  `json:"immature"`
  982. -       SatoshiUsed             *monautil.Amount `json:"used"`
  983. +       Trusted          float64  `json:"trusted"`
  984. +       UntrustedPending float64  `json:"untrusted_pending"`
  985. +       Immature         float64  `json:"immature"`
  986. +       Used             *float64 `json:"used"`
  987.  }
  988.  
  989.  // GetBalancesResult models the data returned from the getbalances command.
  990. diff --git a/btcjson/walletsvrwsntfns_test.go b/btcjson/walletsvrwsntfns_test.go
  991. index fcfe5cbb..8840d3ed 100644
  992. --- a/btcjson/walletsvrwsntfns_test.go
  993. +++ b/btcjson/walletsvrwsntfns_test.go
  994. @@ -104,7 +104,6 @@ func TestWalletSvrWsNtfns(t *testing.T) {
  995.                                         BIP125Replaceable: "unknown",
  996.                                         Category:          "send",
  997.                                         Amount:            1.5,
  998. -                                       AmountSatoshi:     150000000,
  999.                                         Fee:               btcjson.Float64(0.0001),
  1000.                                         Confirmations:     1,
  1001.                                         TxID:              "456",
  1002. diff --git a/docs/README.md b/docs/README.md
  1003. deleted file mode 120000
  1004. index dd0ea36c..00000000
  1005. --- a/docs/README.md
  1006. +++ /dev/null
  1007. @@ -1 +0,0 @@
  1008. -index.md
  1009. \ No newline at end of file
  1010. diff --git a/docs/README.md b/docs/README.md
  1011. new file mode 100644
  1012. index 00000000..82004641
  1013. --- /dev/null
  1014. +++ b/docs/README.md
  1015. @@ -0,0 +1,296 @@
  1016. +### Table of Contents
  1017. +1. [About](#About)
  1018. +2. [Getting Started](#GettingStarted)
  1019. +    1. [Installation](#Installation)
  1020. +        1. [Windows](#WindowsInstallation)
  1021. +        2. [Linux/BSD/MacOSX/POSIX](#PosixInstallation)
  1022. +          1. [Gentoo Linux](#GentooInstallation)
  1023. +    2. [Configuration](#Configuration)
  1024. +    3. [Controlling and Querying monad via btcctl](#BtcctlConfig)
  1025. +    4. [Mining](#Mining)
  1026. +3. [Help](#Help)
  1027. +    1. [Startup](#Startup)
  1028. +        1. [Using bootstrap.dat](#BootstrapDat)
  1029. +    2. [Network Configuration](#NetworkConfig)
  1030. +    3. [Wallet](#Wallet)
  1031. +4. [Contact](#Contact)
  1032. +    1. [IRC](#ContactIRC)
  1033. +    2. [Mailing Lists](#MailingLists)
  1034. +5. [Developer Resources](#DeveloperResources)
  1035. +    1. [Code Contribution Guidelines](#ContributionGuidelines)
  1036. +    2. [JSON-RPC Reference](#JSONRPCReference)
  1037. +    3. [The btcsuite Bitcoin-related Go Packages](#GoPackages)
  1038. +
  1039. +<a name="About" />
  1040. +
  1041. +### 1. About
  1042. +
  1043. +monad is a full node bitcoin implementation written in [Go](http://golang.org),
  1044. +licensed under the [copyfree](http://www.copyfree.org) ISC License.
  1045. +
  1046. +This project is currently under active development and is in a Beta state.  It
  1047. +is extremely stable and has been in production use since October 2013.
  1048. +
  1049. +It properly downloads, validates, and serves the block chain using the exact
  1050. +rules (including consensus bugs) for block acceptance as Bitcoin Core.  We have
  1051. +taken great care to avoid monad causing a fork to the block chain.  It includes a
  1052. +full block validation testing framework which contains all of the 'official'
  1053. +block acceptance tests (and some additional ones) that is run on every pull
  1054. +request to help ensure it properly follows consensus.  Also, it passes all of
  1055. +the JSON test data in the Bitcoin Core code.
  1056. +
  1057. +It also properly relays newly mined blocks, maintains a transaction pool, and
  1058. +relays individual transactions that have not yet made it into a block.  It
  1059. +ensures all individual transactions admitted to the pool follow the rules
  1060. +required by the block chain and also includes more strict checks which filter
  1061. +transactions based on miner requirements ("standard" transactions).
  1062. +
  1063. +One key difference between monad and Bitcoin Core is that monad does *NOT* include
  1064. +wallet functionality and this was a very intentional design decision.  See the
  1065. +blog entry [here](https://web.archive.org/web/20171125143919/https://blog.conformal.com/btcd-not-your-moms-bitcoin-daemon)
  1066. +for more details.  This means you can't actually make or receive payments
  1067. +directly with monad.  That functionality is provided by the
  1068. +[btcwallet](https://github.com/btcsuite/btcwallet) and
  1069. +[Paymetheus](https://github.com/btcsuite/Paymetheus) (Windows-only) projects
  1070. +which are both under active development.
  1071. +
  1072. +<a name="GettingStarted" />
  1073. +
  1074. +### 2. Getting Started
  1075. +
  1076. +<a name="Installation" />
  1077. +
  1078. +**2.1 Installation**
  1079. +
  1080. +The first step is to install monad.  See one of the following sections for
  1081. +details on how to install on the supported operating systems.
  1082. +
  1083. +<a name="WindowsInstallation" />
  1084. +
  1085. +**2.1.1 Windows Installation**<br />
  1086. +
  1087. +* Install the MSI available at: https://github.com/monasuite/monad/releases
  1088. +* Launch monad from the Start Menu
  1089. +
  1090. +<a name="PosixInstallation" />
  1091. +
  1092. +**2.1.2 Linux/BSD/MacOSX/POSIX Installation**
  1093. +
  1094. +
  1095. +- Install Go according to the installation instructions here:
  1096. +  http://golang.org/doc/install
  1097. +
  1098. +- Ensure Go was installed properly and is a supported version:
  1099. +
  1100. +```bash
  1101. +$ go version
  1102. +$ go env GOROOT GOPATH
  1103. +```
  1104. +
  1105. +NOTE: The `GOROOT` and `GOPATH` above must not be the same path.  It is
  1106. +recommended that `GOPATH` is set to a directory in your home directory such as
  1107. +`~/goprojects` to avoid write permission issues.  It is also recommended to add
  1108. +`$GOPATH/bin` to your `PATH` at this point.
  1109. +
  1110. +- Run the following commands to obtain monad, all dependencies, and install it:
  1111. +
  1112. +```bash
  1113. +$ git clone https://github.com/monasuite/monad $GOPATH/src/github.com/monasuite/monad
  1114. +$ cd $GOPATH/src/github.com/monasuite/monad
  1115. +$ GO111MODULE=on go install -v . ./cmd/...
  1116. +```
  1117. +
  1118. +- monad (and utilities) will now be installed in ```$GOPATH/bin```.  If you did
  1119. +  not already add the bin directory to your system path during Go installation,
  1120. +  we recommend you do so now.
  1121. +
  1122. +**Updating**
  1123. +
  1124. +- Run the following commands to update monad, all dependencies, and install it:
  1125. +
  1126. +```bash
  1127. +$ cd $GOPATH/src/github.com/monasuite/monad
  1128. +$ git pull && GO111MODULE=on go install -v . ./cmd/...
  1129. +```
  1130. +
  1131. +<a name="GentooInstallation" />
  1132. +
  1133. +**2.1.2.1 Gentoo Linux Installation**
  1134. +
  1135. +* Install Layman and enable the Bitcoin overlay.
  1136. +  * https://gitlab.com/bitcoin/gentoo
  1137. +* Copy or symlink `/var/lib/layman/bitcoin/Documentation/package.keywords/monad-live` to `/etc/portage/package.keywords/`
  1138. +* Install monad: `$ emerge net-p2p/monad`
  1139. +
  1140. +<a name="Configuration" />
  1141. +
  1142. +**2.2 Configuration**
  1143. +
  1144. +monad has a number of [configuration](http://godoc.org/github.com/monasuite/monad)
  1145. +options, which can be viewed by running: `$ monad --help`.
  1146. +
  1147. +<a name="BtcctlConfig" />
  1148. +
  1149. +**2.3 Controlling and Querying monad via btcctl**
  1150. +
  1151. +btcctl is a command line utility that can be used to both control and query monad
  1152. +via [RPC](http://www.wikipedia.org/wiki/Remote_procedure_call).  monad does
  1153. +**not** enable its RPC server by default;  You must configure at minimum both an
  1154. +RPC username and password or both an RPC limited username and password:
  1155. +
  1156. +* monad.conf configuration file
  1157. +```
  1158. +[Application Options]
  1159. +rpcuser=myuser
  1160. +rpcpass=SomeDecentp4ssw0rd
  1161. +rpclimituser=mylimituser
  1162. +rpclimitpass=Limitedp4ssw0rd
  1163. +```
  1164. +* btcctl.conf configuration file
  1165. +```
  1166. +[Application Options]
  1167. +rpcuser=myuser
  1168. +rpcpass=SomeDecentp4ssw0rd
  1169. +```
  1170. +OR
  1171. +```
  1172. +[Application Options]
  1173. +rpclimituser=mylimituser
  1174. +rpclimitpass=Limitedp4ssw0rd
  1175. +```
  1176. +For a list of available options, run: `$ btcctl --help`
  1177. +
  1178. +<a name="Mining" />
  1179. +
  1180. +**2.4 Mining**
  1181. +
  1182. +monad supports the `getblocktemplate` RPC.
  1183. +The limited user cannot access this RPC.
  1184. +
  1185. +
  1186. +**1. Add the payment addresses with the `miningaddr` option.**
  1187. +
  1188. +```
  1189. +[Application Options]
  1190. +rpcuser=myuser
  1191. +rpcpass=SomeDecentp4ssw0rd
  1192. +miningaddr=12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX
  1193. +miningaddr=1M83ju3EChKYyysmM2FXtLNftbacagd8FR
  1194. +```
  1195. +
  1196. +**2. Add monad's RPC TLS certificate to system Certificate Authority list.**
  1197. +
  1198. +`cgminer` uses [curl](http://curl.haxx.se/) to fetch data from the RPC server.
  1199. +Since curl validates the certificate by default, we must install the `monad` RPC
  1200. +certificate into the default system Certificate Authority list.
  1201. +
  1202. +**Ubuntu**
  1203. +
  1204. +1. Copy rpc.cert to /usr/share/ca-certificates: `# cp /home/user/.monad/rpc.cert /usr/share/ca-certificates/monad.crt`
  1205. +2. Add monad.crt to /etc/ca-certificates.conf: `# echo monad.crt >> /etc/ca-certificates.conf`
  1206. +3. Update the CA certificate list: `# update-ca-certificates`
  1207. +
  1208. +**3. Set your mining software url to use https.**
  1209. +
  1210. +`$ cgminer -o https://127.0.0.1:9400 -u rpcuser -p rpcpassword`
  1211. +
  1212. +<a name="Help" />
  1213. +
  1214. +### 3. Help
  1215. +
  1216. +<a name="Startup" />
  1217. +
  1218. +**3.1 Startup**
  1219. +
  1220. +Typically monad will run and start downloading the block chain with no extra
  1221. +configuration necessary, however, there is an optional method to use a
  1222. +`bootstrap.dat` file that may speed up the initial block chain download process.
  1223. +
  1224. +<a name="BootstrapDat" />
  1225. +
  1226. +**3.1.1 bootstrap.dat**
  1227. +
  1228. +* [Using bootstrap.dat](https://github.com/monasuite/monad/tree/master/docs/using_bootstrap_dat.md)
  1229. +
  1230. +<a name="NetworkConfig" />
  1231. +
  1232. +**3.1.2 Network Configuration**
  1233. +
  1234. +* [What Ports Are Used by Default?](https://github.com/monasuite/monad/tree/master/docs/default_ports.md)
  1235. +* [How To Listen on Specific Interfaces](https://github.com/monasuite/monad/tree/master/docs/configure_peer_server_listen_interfaces.md)
  1236. +* [How To Configure RPC Server to Listen on Specific Interfaces](https://github.com/monasuite/monad/tree/master/docs/configure_rpc_server_listen_interfaces.md)
  1237. +* [Configuring monad with Tor](https://github.com/monasuite/monad/tree/master/docs/configuring_tor.md)
  1238. +
  1239. +<a name="Wallet" />
  1240. +
  1241. +**3.1 Wallet**
  1242. +
  1243. +monad was intentionally developed without an integrated wallet for security
  1244. +reasons.  Please see [btcwallet](https://github.com/btcsuite/btcwallet) for more
  1245. +information.
  1246. +
  1247. +
  1248. +<a name="Contact" />
  1249. +
  1250. +### 4. Contact
  1251. +
  1252. +<a name="ContactIRC" />
  1253. +
  1254. +**4.1 IRC**
  1255. +
  1256. +* [irc.freenode.net](irc://irc.freenode.net), channel `#monad`
  1257. +
  1258. +<a name="MailingLists" />
  1259. +
  1260. +**4.2 Mailing Lists**
  1261. +
  1262. +* <a href="mailto:monad+subscribe@opensource.conformal.com">monad</a>: discussion
  1263. +  of monad and its packages.
  1264. +* <a href="mailto:monad-commits+subscribe@opensource.conformal.com">monad-commits</a>:
  1265. +  readonly mail-out of source code changes.
  1266. +
  1267. +<a name="DeveloperResources" />
  1268. +
  1269. +### 5. Developer Resources
  1270. +
  1271. +<a name="ContributionGuidelines" />
  1272. +
  1273. +* [Code Contribution Guidelines](https://github.com/monasuite/monad/tree/master/docs/code_contribution_guidelines.md)
  1274. +
  1275. +<a name="JSONRPCReference" />
  1276. +
  1277. +* [JSON-RPC Reference](https://github.com/monasuite/monad/tree/master/docs/json_rpc_api.md)
  1278. +    * [RPC Examples](https://github.com/monasuite/monad/tree/master/docs/json_rpc_api.md#ExampleCode)
  1279. +
  1280. +<a name="GoPackages" />
  1281. +
  1282. +* The btcsuite Bitcoin-related Go Packages:
  1283. +    * [btcrpcclient](https://github.com/btcsuite/btcd/tree/master/rpcclient) - Implements a
  1284. +      robust and easy to use Websocket-enabled Bitcoin JSON-RPC client
  1285. +    * [btcjson](https://github.com/btcsuite/btcd/tree/master/btcjson) - Provides an extensive API
  1286. +      for the underlying JSON-RPC command and return values
  1287. +    * [wire](https://github.com/monasuite/monad/tree/master/wire) - Implements the
  1288. +      Bitcoin wire protocol
  1289. +    * [peer](https://github.com/monasuite/monad/tree/master/peer) -
  1290. +      Provides a common base for creating and managing Bitcoin network peers.
  1291. +    * [blockchain](https://github.com/monasuite/monad/tree/master/blockchain) -
  1292. +      Implements Bitcoin block handling and chain selection rules
  1293. +    * [blockchain/fullblocktests](https://github.com/monasuite/monad/tree/master/blockchain/fullblocktests) -
  1294. +      Provides a set of block tests for testing the consensus validation rules
  1295. +    * [txscript](https://github.com/monasuite/monad/tree/master/txscript) -
  1296. +      Implements the Bitcoin transaction scripting language
  1297. +    * [btcec](https://github.com/monasuite/monad/tree/master/btcec) - Implements
  1298. +      support for the elliptic curve cryptographic functions needed for the
  1299. +      Bitcoin scripts
  1300. +    * [database](https://github.com/monasuite/monad/tree/master/database) -
  1301. +      Provides a database interface for the Bitcoin block chain
  1302. +    * [mempool](https://github.com/monasuite/monad/tree/master/mempool) -
  1303. +      Package mempool provides a policy-enforced pool of unmined bitcoin
  1304. +      transactions.
  1305. +    * [monautil](https://github.com/monasuite/monautil) - Provides Bitcoin-specific
  1306. +      convenience functions and types
  1307. +    * [chainhash](https://github.com/monasuite/monad/tree/master/chaincfg/chainhash) -
  1308. +      Provides a generic hash type and associated functions that allows the
  1309. +      specific hash algorithm to be abstracted.
  1310. +    * [connmgr](https://github.com/monasuite/monad/tree/master/connmgr) -
  1311. +      Package connmgr implements a generic Bitcoin network connection manager.
  1312. diff --git a/docs/configuring_tor.md b/docs/configuring_tor.md
  1313. index ad2a8e79..f474372f 100644
  1314. --- a/docs/configuring_tor.md
  1315. +++ b/docs/configuring_tor.md
  1316. @@ -34,7 +34,11 @@ not be reachable for inbound connections unless you also configure a Tor
  1317.  ### Command line example
  1318.  
  1319.  ```bash
  1320. -./monad --proxy=127.0.0.1:9050
  1321. +<<<<<<< HEAD
  1322. +$ ./monad --proxy=127.0.0.1:9050
  1323. +=======
  1324. +./btcd --proxy=127.0.0.1:9050
  1325. +>>>>>>> upstream/master
  1326.  ```
  1327.  
  1328.  ### Config file example
  1329. @@ -76,7 +80,11 @@ three flags:
  1330.  ### Command line example
  1331.  
  1332.  ```bash
  1333. -./monad --proxy=127.0.0.1:9050 --listen=127.0.0.1 --externalip=fooanon.onion
  1334. +<<<<<<< HEAD
  1335. +$ ./monad --proxy=127.0.0.1:9050 --listen=127.0.0.1 --externalip=fooanon.onion
  1336. +=======
  1337. +./btcd --proxy=127.0.0.1:9050 --listen=127.0.0.1 --externalip=fooanon.onion
  1338. +>>>>>>> upstream/master
  1339.  ```
  1340.  
  1341.  ### Config file example
  1342. @@ -111,7 +119,11 @@ routed via Tor due to the `--onion` flag.
  1343.  ### Command line example
  1344.  
  1345.  ```bash
  1346. -./monad --onion=127.0.0.1:9050 --externalip=fooanon.onion
  1347. +<<<<<<< HEAD
  1348. +$ ./monad --onion=127.0.0.1:9050 --externalip=fooanon.onion
  1349. +=======
  1350. +./btcd --onion=127.0.0.1:9050 --externalip=fooanon.onion
  1351. +>>>>>>> upstream/master
  1352.  ```
  1353.  
  1354.  ### Config file example
  1355. @@ -134,7 +146,11 @@ flag.  This option requires --proxy or --onionproxy to be set.
  1356.  ### Command line example
  1357.  
  1358.  ```bash
  1359. -./monad --proxy=127.0.0.1:9050 --torisolation
  1360. +<<<<<<< HEAD
  1361. +$ ./monad --proxy=127.0.0.1:9050 --torisolation
  1362. +=======
  1363. +./btcd --proxy=127.0.0.1:9050 --torisolation
  1364. +>>>>>>> upstream/master
  1365.  ```
  1366.  
  1367.  ### Config file example
  1368. diff --git a/go.mod b/go.mod
  1369. index 69948583..5e4752cb 100644
  1370. --- a/go.mod
  1371. +++ b/go.mod
  1372. @@ -10,9 +10,7 @@ require (
  1373.         github.com/decred/dcrd/lru v1.0.0
  1374.         github.com/jessevdk/go-flags v1.4.0
  1375.         github.com/jrick/logrotate v1.0.0
  1376. -       github.com/monasuite/monautil v1.1.2
  1377. -       github.com/onsi/ginkgo v1.7.0 // indirect
  1378. -       github.com/onsi/gomega v1.4.3 // indirect
  1379. +       github.com/monasuite/monautil v1.1.1
  1380.         github.com/shopspring/decimal v1.2.0
  1381.         github.com/wakiyamap/lyra2rev2 v0.1.2
  1382.         golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37
  1383. diff --git a/go.sum b/go.sum
  1384. index 66467fab..94d15b8e 100644
  1385. --- a/go.sum
  1386. +++ b/go.sum
  1387. @@ -10,17 +10,24 @@ github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JG
  1388.  github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
  1389.  github.com/btcsuite/golangcrypto v0.0.0-20150304025918-53f62d9b43e8 h1:nOsAWScwueMVk/VLm/dvQQD7DuanyvAUb6B3P3eT274=
  1390.  github.com/btcsuite/golangcrypto v0.0.0-20150304025918-53f62d9b43e8/go.mod h1:tYvUd8KLhm/oXvUeSEs2VlLghFjQt9+ZaF9ghH0JNjc=
  1391. +github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd h1:qdGvebPBDuYDPGi1WCPjy1tGyMpmDK8IEapSsszn7HE=
  1392. +github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY=
  1393.  github.com/btcsuite/goleveldb v1.0.0 h1:Tvd0BfvqX9o823q1j2UZ/epQo09eJh6dTcRp79ilIN4=
  1394.  github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I=
  1395. +github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723 h1:ZA/jbKoGcVAnER6pCHPEkGdZOV7U1oLUedErBHCUMs0=
  1396. +github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
  1397.  github.com/btcsuite/snappy-go v1.0.0 h1:ZxaA6lo2EpxGddsA8JwWOcxlzRybb444sgmeJQMJGQE=
  1398.  github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
  1399.  github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 h1:R8vQdOQdZ9Y3SkEwmHoWBmX1DNXhXZqlTpq6s4tyJGc=
  1400.  github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
  1401.  github.com/btcsuite/winsvc v1.0.0 h1:J9B4L7e3oqhXOcm+2IuNApwzQec85lE+QaikUcCs+dk=
  1402.  github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
  1403. +github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
  1404.  github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
  1405.  github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
  1406.  github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
  1407. +github.com/dchest/blake256 v1.0.0 h1:6gUgI5MHdz9g0TdrgKqXsoDX+Zjxmm1Sc6OsoGru50I=
  1408. +github.com/dchest/blake256 v1.0.0/go.mod h1:xXNWCE1jsAP8DAjP+rKw2MbeqLczjI3TRx2VK+9OEYY=
  1409.  github.com/dchest/blake256 v1.1.0 h1:4AuEhGPT/3TTKFhTfBpZ8hgZE7wJpawcYaEawwsbtqM=
  1410.  github.com/dchest/blake256 v1.1.0/go.mod h1:xXNWCE1jsAP8DAjP+rKw2MbeqLczjI3TRx2VK+9OEYY=
  1411.  github.com/decred/dcrd/lru v1.0.0 h1:Kbsb1SFDsIlaupWPwsPp+dkxiBY1frcS07PCPgotKz8=
  1412. @@ -32,23 +39,27 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y
  1413.  github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
  1414.  github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
  1415.  github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
  1416. +github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89 h1:12K8AlpT0/6QUXSfV0yi4Q0jkbq8NDtIKFtF61AoqV0=
  1417. +github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
  1418.  github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
  1419.  github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
  1420.  github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI=
  1421.  github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
  1422. +github.com/kkdai/bstream v0.0.0-20181106074824-b3251f7901ec h1:n1NeQ3SgUHyISrjFFoO5dR748Is8dBL9qpaTNfphQrs=
  1423. +github.com/kkdai/bstream v0.0.0-20181106074824-b3251f7901ec/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
  1424.  github.com/kkdai/bstream v1.0.0 h1:Se5gHwgp2VT2uHfDrkbbgbgEvV9cimLELwrPJctSjg8=
  1425.  github.com/kkdai/bstream v1.0.0/go.mod h1:FDnDOHt5Yx4p3FaHcioFT0QjDOtgUpvjeZqAs+NVZZA=
  1426.  github.com/monasuite/monad v0.21.0-beta/go.mod h1:3Xp+i5gmkjEl2pUvj558OUuLsMqjB5S3663Nr0yRa58=
  1427.  github.com/monasuite/monad v0.22.0-beta/go.mod h1:ZHQyEBbhHEPYyhDn9VxJoWW2GJ5lZgOUtIw4xMVOAVE=
  1428. -github.com/monasuite/monad v0.22.1-beta/go.mod h1:Z8IF4S54MQMjSoQ+2KAJdewQVuJsYGZ7i1fOtHgk5Zc=
  1429. +github.com/monasuite/monautil v0.0.0-20190606162653-90b266792864 h1:pMKZU4hTeLssZCspx+e7yTjoluCNxcL+OPF6ipqZeHI=
  1430.  github.com/monasuite/monautil v0.0.0-20190606162653-90b266792864/go.mod h1:kIVSL9QpyEYOh60Z7DIAAIhzOd9pHpRbMA3rOqVXOwc=
  1431. +github.com/monasuite/monautil v1.0.2 h1:lDEAgecY4QBpNP6/qZpDb6RaIsbxxCWoohg0Xc5kfUE=
  1432. +github.com/monasuite/monautil v1.0.2/go.mod h1:yQwTTNPBDW7ohztctinZ+oZRTB968tVpaDFR/+8h69E=
  1433. +github.com/monasuite/monautil v1.1.0 h1:LSnduPcag9hdqqOFch4oATY2SenC2OVMfMUMly/eOCU=
  1434.  github.com/monasuite/monautil v1.1.0/go.mod h1:b5tmGuaSp+AMFptTgNUuYWwct+WTaS+lSh2yUkQQQvw=
  1435.  github.com/monasuite/monautil v1.1.1 h1:My6v9Z0p+d357Q6TRM9p1k4nhQmJIs3s7yqn+lZn9Cs=
  1436.  github.com/monasuite/monautil v1.1.1/go.mod h1:N1fiuHcY7yZtugY+8dUeJyFjcBRJvk1z/P/KpGpkHU4=
  1437. -github.com/monasuite/monautil v1.1.2 h1:TUpcVByvA6PbsFm0LcBAmfDxEsnBmQqxMaRk0syitSs=
  1438. -github.com/monasuite/monautil v1.1.2/go.mod h1:KoMmpGVTPshQyrwP5L6Uno09htl1BdVjHI/OhZ+zzA8=
  1439.  github.com/monasuite/monautil/psbt v1.0.1/go.mod h1:7WRjsuiM52783pB5V68DM+A5EUFGQEPGZy7wd70Xay4=
  1440. -github.com/monasuite/monautil/psbt v1.1.0/go.mod h1:x3L79SW2/BzpLuvRU2RNEGZmbnlQZ69exKFyld5XKtI=
  1441.  github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
  1442.  github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs=
  1443.  github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
  1444. @@ -63,7 +74,10 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
  1445.  github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
  1446.  github.com/wakiyamap/lyra2rev2 v0.1.2 h1:71gcx9YP9t8XJFBx/2jFbM/K0SuUbcQoX/NBSXczeFk=
  1447.  github.com/wakiyamap/lyra2rev2 v0.1.2/go.mod h1:G4rxLM39S2icKsHDBtzrUeEKM+7wRNEwhgpRjkYadn8=
  1448. +golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44 h1:9lP3x0pW80sDI6t1UMSLA4to18W7R7imwAI/sWS9S8Q=
  1449. +golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
  1450.  golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
  1451. +golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
  1452.  golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
  1453.  golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 h1:cg5LA/zNPRzIXIWSCxQW10Rvpy94aQh3LT/ShoCpkHw=
  1454.  golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
  1455. @@ -82,12 +96,6 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
  1456.  golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
  1457.  golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
  1458.  gopkg.in/alecthomas/kingpin.v3-unstable v3.0.0-20191105091915-95d230a53780/go.mod h1:3HH7i1SgMqlzxCcBmUHW657sD4Kvv9sC3HpL3YukzwA=
  1459. -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
  1460.  gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
  1461. -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
  1462. -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
  1463. -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
  1464. -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
  1465.  gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  1466. -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
  1467.  gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  1468. diff --git a/rpcclient/rawtransactions.go b/rpcclient/rawtransactions.go
  1469. index c44496a5..0ceb26e0 100644
  1470. --- a/rpcclient/rawtransactions.go
  1471. +++ b/rpcclient/rawtransactions.go
  1472. @@ -13,7 +13,6 @@ import (
  1473.         "github.com/monasuite/monad/chaincfg/chainhash"
  1474.         "github.com/monasuite/monad/wire"
  1475.         "github.com/monasuite/monautil"
  1476. -       "github.com/shopspring/decimal"
  1477.  )
  1478.  
  1479.  const (
  1480. @@ -294,9 +293,9 @@ func (r FutureCreateRawTransactionResult) Receive() (*wire.MsgTx, error) {
  1481.  func (c *Client) CreateRawTransactionAsync(inputs []btcjson.TransactionInput,
  1482.         amounts map[monautil.Address]monautil.Amount, lockTime *int64) FutureCreateRawTransactionResult {
  1483.  
  1484. -       convertedAmts := make(map[string]decimal.Decimal, len(amounts))
  1485. +       convertedAmts := make(map[string]float64, len(amounts))
  1486.         for addr, amount := range amounts {
  1487. -               convertedAmts[addr.String()] = amount.ToDecimalBTC()
  1488. +               convertedAmts[addr.String()] = amount.ToBTC()
  1489.         }
  1490.         cmd := btcjson.NewCreateRawTransactionCmd(inputs, convertedAmts, lockTime)
  1491.         return c.sendCmd(cmd)
  1492. diff --git a/rpcclient/wallet.go b/rpcclient/wallet.go
  1493. index 67b7ec24..fd285d33 100644
  1494. --- a/rpcclient/wallet.go
  1495. +++ b/rpcclient/wallet.go
  1496. @@ -475,7 +475,7 @@ func (r FutureSetTxFeeResult) Receive() error {
  1497.  //
  1498.  // See SetTxFee for the blocking version and more details.
  1499.  func (c *Client) SetTxFeeAsync(fee monautil.Amount) FutureSetTxFeeResult {
  1500. -       cmd := btcjson.NewSetTxFeeCmd(fee.ToDecimalBTC())
  1501. +       cmd := btcjson.NewSetTxFeeCmd(fee.ToBTC())
  1502.         return c.sendCmd(cmd)
  1503.  }
  1504.  
  1505. @@ -514,7 +514,7 @@ func (r FutureSendToAddressResult) Receive() (*chainhash.Hash, error) {
  1506.  // See SendToAddress for the blocking version and more details.
  1507.  func (c *Client) SendToAddressAsync(address monautil.Address, amount monautil.Amount) FutureSendToAddressResult {
  1508.         addr := address.EncodeAddress()
  1509. -       cmd := btcjson.NewSendToAddressCmd(addr, amount.ToDecimalBTC(), nil, nil)
  1510. +       cmd := btcjson.NewSendToAddressCmd(addr, amount.ToBTC(), nil, nil)
  1511.         return c.sendCmd(cmd)
  1512.  }
  1513.  
  1514. @@ -540,7 +540,7 @@ func (c *Client) SendToAddressCommentAsync(address monautil.Address,
  1515.         commentTo string) FutureSendToAddressResult {
  1516.  
  1517.         addr := address.EncodeAddress()
  1518. -       cmd := btcjson.NewSendToAddressCmd(addr, amount.ToDecimalBTC(), &comment,
  1519. +       cmd := btcjson.NewSendToAddressCmd(addr, amount.ToBTC(), &comment,
  1520.                 &commentTo)
  1521.         return c.sendCmd(cmd)
  1522.  }
  1523. @@ -593,7 +593,7 @@ func (r FutureSendFromResult) Receive() (*chainhash.Hash, error) {
  1524.  // See SendFrom for the blocking version and more details.
  1525.  func (c *Client) SendFromAsync(fromAccount string, toAddress monautil.Address, amount monautil.Amount) FutureSendFromResult {
  1526.         addr := toAddress.EncodeAddress()
  1527. -       cmd := btcjson.NewSendFromCmd(fromAccount, addr, amount.ToDecimalBTC(), nil,
  1528. +       cmd := btcjson.NewSendFromCmd(fromAccount, addr, amount.ToBTC(), nil,
  1529.                 nil, nil)
  1530.         return c.sendCmd(cmd)
  1531.  }
  1532. @@ -617,7 +617,7 @@ func (c *Client) SendFrom(fromAccount string, toAddress monautil.Address, amount
  1533.  // See SendFromMinConf for the blocking version and more details.
  1534.  func (c *Client) SendFromMinConfAsync(fromAccount string, toAddress monautil.Address, amount monautil.Amount, minConfirms int) FutureSendFromResult {
  1535.         addr := toAddress.EncodeAddress()
  1536. -       cmd := btcjson.NewSendFromCmd(fromAccount, addr, amount.ToDecimalBTC(),
  1537. +       cmd := btcjson.NewSendFromCmd(fromAccount, addr, amount.ToBTC(),
  1538.                 &minConfirms, nil, nil)
  1539.         return c.sendCmd(cmd)
  1540.  }
  1541. @@ -646,7 +646,7 @@ func (c *Client) SendFromCommentAsync(fromAccount string,
  1542.         comment, commentTo string) FutureSendFromResult {
  1543.  
  1544.         addr := toAddress.EncodeAddress()
  1545. -       cmd := btcjson.NewSendFromCmd(fromAccount, addr, amount.ToDecimalBTC(),
  1546. +       cmd := btcjson.NewSendFromCmd(fromAccount, addr, amount.ToBTC(),
  1547.                 &minConfirms, &comment, &commentTo)
  1548.         return c.sendCmd(cmd)
  1549.  }
  1550. @@ -700,9 +700,9 @@ func (r FutureSendManyResult) Receive() (*chainhash.Hash, error) {
  1551.  //
  1552.  // See SendMany for the blocking version and more details.
  1553.  func (c *Client) SendManyAsync(fromAccount string, amounts map[monautil.Address]monautil.Amount) FutureSendManyResult {
  1554. -       convertedAmounts := make(map[string]decimal.Decimal, len(amounts))
  1555. +       convertedAmounts := make(map[string]float64, len(amounts))
  1556.         for addr, amount := range amounts {
  1557. -               convertedAmounts[addr.EncodeAddress()] = amount.ToDecimalBTC()
  1558. +               convertedAmounts[addr.EncodeAddress()] = amount.ToBTC()
  1559.         }
  1560.         cmd := btcjson.NewSendManyCmd(fromAccount, convertedAmounts, nil, nil)
  1561.         return c.sendCmd(cmd)
  1562. @@ -729,9 +729,9 @@ func (c *Client) SendManyMinConfAsync(fromAccount string,
  1563.         amounts map[monautil.Address]monautil.Amount,
  1564.         minConfirms int) FutureSendManyResult {
  1565.  
  1566. -       convertedAmounts := make(map[string]decimal.Decimal, len(amounts))
  1567. +       convertedAmounts := make(map[string]float64, len(amounts))
  1568.         for addr, amount := range amounts {
  1569. -               convertedAmounts[addr.EncodeAddress()] = amount.ToDecimalBTC()
  1570. +               convertedAmounts[addr.EncodeAddress()] = amount.ToBTC()
  1571.         }
  1572.         cmd := btcjson.NewSendManyCmd(fromAccount, convertedAmounts,
  1573.                 &minConfirms, nil)
  1574. @@ -763,9 +763,9 @@ func (c *Client) SendManyCommentAsync(fromAccount string,
  1575.         amounts map[monautil.Address]monautil.Amount, minConfirms int,
  1576.         comment string) FutureSendManyResult {
  1577.  
  1578. -       convertedAmounts := make(map[string]decimal.Decimal, len(amounts))
  1579. +       convertedAmounts := make(map[string]float64, len(amounts))
  1580.         for addr, amount := range amounts {
  1581. -               convertedAmounts[addr.EncodeAddress()] = amount.ToDecimalBTC()
  1582. +               convertedAmounts[addr.EncodeAddress()] = amount.ToBTC()
  1583.         }
  1584.         cmd := btcjson.NewSendManyCmd(fromAccount, convertedAmounts,
  1585.                 &minConfirms, &comment)
  1586. @@ -1244,7 +1244,7 @@ func (r FutureMoveResult) Receive() (bool, error) {
  1587.  //
  1588.  // See Move for the blocking version and more details.
  1589.  func (c *Client) MoveAsync(fromAccount, toAccount string, amount monautil.Amount) FutureMoveResult {
  1590. -       cmd := btcjson.NewMoveCmd(fromAccount, toAccount, amount.ToDecimalBTC(), nil,
  1591. +       cmd := btcjson.NewMoveCmd(fromAccount, toAccount, amount.ToBTC(), nil,
  1592.                 nil)
  1593.         return c.sendCmd(cmd)
  1594.  }
  1595. @@ -1265,7 +1265,7 @@ func (c *Client) Move(fromAccount, toAccount string, amount monautil.Amount) (bo
  1596.  func (c *Client) MoveMinConfAsync(fromAccount, toAccount string,
  1597.         amount monautil.Amount, minConfirms int) FutureMoveResult {
  1598.  
  1599. -       cmd := btcjson.NewMoveCmd(fromAccount, toAccount, amount.ToDecimalBTC(),
  1600. +       cmd := btcjson.NewMoveCmd(fromAccount, toAccount, amount.ToBTC(),
  1601.                 &minConfirms, nil)
  1602.         return c.sendCmd(cmd)
  1603.  }
  1604. @@ -1288,7 +1288,7 @@ func (c *Client) MoveMinConf(fromAccount, toAccount string, amount monautil.Amou
  1605.  func (c *Client) MoveCommentAsync(fromAccount, toAccount string,
  1606.         amount monautil.Amount, minConfirms int, comment string) FutureMoveResult {
  1607.  
  1608. -       cmd := btcjson.NewMoveCmd(fromAccount, toAccount, amount.ToDecimalBTC(),
  1609. +       cmd := btcjson.NewMoveCmd(fromAccount, toAccount, amount.ToBTC(),
  1610.                 &minConfirms, &comment)
  1611.         return c.sendCmd(cmd)
  1612.  }
  1613. diff --git a/rpcserver.go b/rpcserver.go
  1614. index b5508b11..53c2a3b6 100644
  1615. --- a/rpcserver.go
  1616. +++ b/rpcserver.go
  1617. @@ -560,8 +560,7 @@ func handleCreateRawTransaction(s *rpcServer, cmd interface{}, closeChan <-chan
  1618.         params := s.cfg.ChainParams
  1619.         for encodedAddr, amount := range c.Amounts {
  1620.                 // Ensure amount is in the valid range for monetary amounts.
  1621. -               if amount.Cmp(decimal.NewFromFloat(0)) != 1 ||
  1622. -                       amount.Mul(decimal.NewFromInt(monautil.SatoshiPerBitcoin)).Cmp(decimal.NewFromInt(monautil.MaxSatoshi)) == 1 {
  1623. +               if amount <= 0 || amount*monautil.SatoshiPerBitcoin > monautil.MaxSatoshi {
  1624.                         return nil, &btcjson.RPCError{
  1625.                                 Code:    btcjson.ErrRPCType,
  1626.                                 Message: "Invalid amount",
  1627. @@ -605,7 +604,7 @@ func handleCreateRawTransaction(s *rpcServer, cmd interface{}, closeChan <-chan
  1628.                 }
  1629.  
  1630.                 // Convert the amount to satoshi.
  1631. -               satoshi, err := monautil.NewAmount(amount)
  1632. +               satoshi, err := monautil.NewAmount(decimal.NewFromFloat(amount))
  1633.                 if err != nil {
  1634.                         context := "Failed to convert amount"
  1635.                         return nil, internalRPCError(err.Error(), context)
  1636. @@ -2902,7 +2901,6 @@ func handleGetTxOut(s *rpcServer, cmd interface{}, closeChan <-chan struct{}) (i
  1637.                 BestBlock:     bestBlockHash,
  1638.                 Confirmations: int64(confirmations),
  1639.                 Value:         monautil.Amount(value).ToBTC(),
  1640. -               Amount:        monautil.Amount(value),
  1641.                 ScriptPubKey: btcjson.ScriptPubKeyResult{
  1642.                         Asm:       disbuf,
  1643.                         Hex:       hex.EncodeToString(pkScript),
  1644. diff --git a/rpcserverhelp.go b/rpcserverhelp.go
  1645. index e8bdbd61..022c0154 100644
  1646. --- a/rpcserverhelp.go
  1647. +++ b/rpcserverhelp.go
  1648. @@ -63,7 +63,6 @@ var helpDescsEnUS = map[string]string{
  1649.         // PrevOut help.
  1650.         "prevout-addresses": "previous output addresses",
  1651.         "prevout-value":     "previous output value",
  1652. -       "prevout-amount":    "previous output value in satoshi",
  1653.  
  1654.         // VinPrevOut help.
  1655.         "vinprevout-coinbase":    "The hex-encoded bytes of the signature script (coinbase txns only)",
  1656. @@ -93,7 +92,6 @@ var helpDescsEnUS = map[string]string{
  1657.         "vout-value":        "The amount in BTC",
  1658.         "vout-n":            "The index of this transaction output",
  1659.         "vout-scriptPubKey": "The public key script used to pay coins as a JSON object",
  1660. -       "vout-amount":       "The amount in satoshi",
  1661.  
  1662.         // TxRawDecodeResult help.
  1663.         "txrawdecoderesult-txid":     "The hash of the transaction",
  1664. @@ -538,7 +536,6 @@ var helpDescsEnUS = map[string]string{
  1665.         "gettxoutresult-bestblock":     "The block hash that contains the transaction output",
  1666.         "gettxoutresult-confirmations": "The number of confirmations",
  1667.         "gettxoutresult-value":         "The transaction amount in BTC",
  1668. -       "gettxoutresult-amount":        "The transaction amount in satoshi",
  1669.         "gettxoutresult-scriptPubKey":  "The public key script used to pay coins as a JSON object",
  1670.         "gettxoutresult-version":       "The transaction version",
  1671.         "gettxoutresult-coinbase":      "Whether or not the transaction is a coinbase",
  1672. diff --git a/rpcwebsocket.go b/rpcwebsocket.go
  1673. index 49aad3cd..a78ffc57 100644
  1674. --- a/rpcwebsocket.go
  1675. +++ b/rpcwebsocket.go
  1676. @@ -830,8 +830,7 @@ func (m *wsNotificationManager) notifyForNewTx(clients map[chan struct{}]*wsClie
  1677.                 amount += txOut.Value
  1678.         }
  1679.  
  1680. -       tAmount := monautil.Amount(amount)
  1681. -       ntfn := btcjson.NewTxAcceptedNtfn(txHashStr, tAmount.ToDecimalBTC())
  1682. +       ntfn := btcjson.NewTxAcceptedNtfn(txHashStr, monautil.Amount(amount).ToBTC())
  1683.         marshalledJSON, err := btcjson.MarshalCmd(nil, ntfn)
  1684.         if err != nil {
  1685.                 rpcsLog.Errorf("Failed to marshal tx notification: %s", err.Error())
  1686. diff --git a/server.go b/server.go
  1687. index 11c632ec..e4c0bf01 100644
  1688. --- a/server.go
  1689. +++ b/server.go
  1690. @@ -2120,7 +2120,6 @@ func newPeerConfig(sp *serverPeer) *peer.Config {
  1691.                         // not signed with its key.  We could verify against their key, but
  1692.                         // since the reference client is currently unwilling to support
  1693.                         // other implementations' alert messages, we will not relay theirs.
  1694. -                       // monacoin is OK?
  1695.                         //OnAlert: nil,
  1696.                 },
  1697.                 NewestBlock:       sp.newestBlock,
  1698.