diff --git a/rpcclient/chain.go b/rpcclient/chain.go index e7cd976786..d0cdd9bc15 100644 --- a/rpcclient/chain.go +++ b/rpcclient/chain.go @@ -22,7 +22,7 @@ type FutureGetBestBlockHashResult chan *Response // Receive waits for the Response promised by the future and returns the hash of // the best block in the longest block chain. func (r FutureGetBestBlockHashResult) Receive() (*chainhash.Hash, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -81,7 +81,7 @@ func (c *Client) legacyGetBlockRequest(hash string, verbose, func (c *Client) waitForGetBlockRes(respChan chan *Response, hash string, verbose, verboseTx bool) ([]byte, error) { - res, err := receiveFuture(respChan) + res, err := ReceiveFuture(respChan) // If we receive an invalid parameter error, then we may be // communicating with a btcd node which only understands the legacy @@ -278,7 +278,7 @@ type FutureGetBlockCountResult chan *Response // Receive waits for the Response promised by the future and returns the number // of blocks in the longest block chain. func (r FutureGetBlockCountResult) Receive() (int64, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return 0, err } @@ -314,7 +314,7 @@ type FutureGetDifficultyResult chan *Response // Receive waits for the Response promised by the future and returns the // proof-of-work difficulty as a multiple of the minimum difficulty. func (r FutureGetDifficultyResult) Receive() (float64, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return 0, err } @@ -391,7 +391,7 @@ func unmarshalGetBlockChainInfoResultSoftForks(chainInfo *btcjson.GetBlockChainI // Receive waits for the Response promised by the future and returns chain info // result provided by the server. func (r FutureGetBlockChainInfoResult) Receive() (*btcjson.GetBlockChainInfoResult, error) { - res, err := receiveFuture(r.Response) + res, err := ReceiveFuture(r.Response) if err != nil { return nil, err } @@ -442,7 +442,7 @@ type FutureGetBlockHashResult chan *Response // Receive waits for the Response promised by the future and returns the hash of // the block in the best block chain at the given height. func (r FutureGetBlockHashResult) Receive() (*chainhash.Hash, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -479,7 +479,7 @@ type FutureGetBlockHeaderResult chan *Response // Receive waits for the Response promised by the future and returns the // blockheader requested from the server given its hash. func (r FutureGetBlockHeaderResult) Receive() (*wire.BlockHeader, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -536,7 +536,7 @@ type FutureGetBlockHeaderVerboseResult chan *Response // Receive waits for the Response promised by the future and returns the // data structure of the blockheader requested from the server given its hash. func (r FutureGetBlockHeaderVerboseResult) Receive() (*btcjson.GetBlockHeaderVerboseResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -582,7 +582,7 @@ type FutureGetMempoolEntryResult chan *Response // structure with information about the transaction in the memory pool given // its hash. func (r FutureGetMempoolEntryResult) Receive() (*btcjson.GetMempoolEntryResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -620,7 +620,7 @@ type FutureGetRawMempoolResult chan *Response // Receive waits for the Response promised by the future and returns the hashes // of all transactions in the memory pool. func (r FutureGetRawMempoolResult) Receive() ([]*chainhash.Hash, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -671,7 +671,7 @@ type FutureGetRawMempoolVerboseResult chan *Response // transaction hashes to an associated data structure with information about the // transaction for all transactions in the memory pool. func (r FutureGetRawMempoolVerboseResult) Receive() (map[string]btcjson.GetRawMempoolVerboseResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -712,7 +712,7 @@ type FutureEstimateFeeResult chan *Response // Receive waits for the Response promised by the future and returns the info // provided by the server. func (r FutureEstimateFeeResult) Receive() (float64, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return -1, err } @@ -749,7 +749,7 @@ type FutureEstimateSmartFeeResult chan *Response // Receive waits for the response promised by the future and returns the // estimated fee. func (r FutureEstimateSmartFeeResult) Receive() (*btcjson.EstimateSmartFeeResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -786,7 +786,7 @@ type FutureVerifyChainResult chan *Response // or not the chain verified based on the check level and number of blocks // to verify specified in the original call. func (r FutureVerifyChainResult) Receive() (bool, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return false, err } @@ -873,7 +873,7 @@ type FutureGetTxOutResult chan *Response // Receive waits for the Response promised by the future and returns a // transaction given its hash. func (r FutureGetTxOutResult) Receive() (*btcjson.GetTxOutResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -928,7 +928,7 @@ type FutureRescanBlocksResult chan *Response // NOTE: This is a btcsuite extension ported from // github.com/decred/dcrrpcclient. func (r FutureRescanBlocksResult) Receive() ([]btcjson.RescannedBlock, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -977,7 +977,7 @@ type FutureInvalidateBlockResult chan *Response // Receive waits for the Response promised by the future and returns the raw // block requested from the server given its hash. func (r FutureInvalidateBlockResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -1009,7 +1009,7 @@ type FutureGetCFilterResult chan *Response // Receive waits for the Response promised by the future and returns the raw // filter requested from the server given its block hash. func (r FutureGetCFilterResult) Receive() (*wire.MsgCFilter, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -1064,7 +1064,7 @@ type FutureGetCFilterHeaderResult chan *Response // Receive waits for the Response promised by the future and returns the raw // filter header requested from the server given its block hash. func (r FutureGetCFilterHeaderResult) Receive() (*wire.MsgCFHeaders, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -1118,7 +1118,7 @@ type FutureGetBlockStatsResult chan *Response // Receive waits for the response promised by the future and returns statistics // of a block at a certain height. func (r FutureGetBlockStatsResult) Receive() (*btcjson.GetBlockStatsResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } diff --git a/rpcclient/extensions.go b/rpcclient/extensions.go index f7289d22ef..c8615293e3 100644 --- a/rpcclient/extensions.go +++ b/rpcclient/extensions.go @@ -26,7 +26,7 @@ type FutureDebugLevelResult chan *Response // of setting the debug logging level to the passed level specification or the // list of of the available subsystems for the special keyword 'show'. func (r FutureDebugLevelResult) Receive() (string, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return "", err } @@ -72,7 +72,7 @@ type FutureCreateEncryptedWalletResult chan *Response // Receive waits for and returns the error Response promised by the future. func (r FutureCreateEncryptedWalletResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -107,7 +107,7 @@ type FutureListAddressTransactionsResult chan *Response // Receive waits for the Response promised by the future and returns information // about all transactions associated with the provided addresses. func (r FutureListAddressTransactionsResult) Receive() ([]btcjson.ListTransactionsResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -153,7 +153,7 @@ type FutureGetBestBlockResult chan *Response // Receive waits for the Response promised by the future and returns the hash // and height of the block in the longest (best) chain. func (r FutureGetBestBlockResult) Receive() (*chainhash.Hash, int32, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, 0, err } @@ -201,7 +201,7 @@ type FutureGetCurrentNetResult chan *Response // Receive waits for the Response promised by the future and returns the network // the server is running on. func (r FutureGetCurrentNetResult) Receive() (wire.BitcoinNet, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return 0, err } @@ -248,7 +248,7 @@ type FutureGetHeadersResult chan *Response // NOTE: This is a btcsuite extension ported from // github.com/decred/dcrrpcclient. func (r FutureGetHeadersResult) Receive() ([]wire.BlockHeader, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -312,7 +312,7 @@ type FutureExportWatchingWalletResult chan *Response // Receive waits for the Response promised by the future and returns the // exported wallet. func (r FutureExportWatchingWalletResult) Receive() ([]byte, []byte, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, nil, err } @@ -381,7 +381,7 @@ type FutureSessionResult chan *Response // Receive waits for the Response promised by the future and returns the // session result. func (r FutureSessionResult) Receive() (*btcjson.SessionResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -436,7 +436,7 @@ type FutureVersionResult chan *Response // github.com/decred/dcrrpcclient. func (r FutureVersionResult) Receive() (map[string]btcjson.VersionResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } diff --git a/rpcclient/infrastructure.go b/rpcclient/infrastructure.go index 9f32b085bc..a553a691a2 100644 --- a/rpcclient/infrastructure.go +++ b/rpcclient/infrastructure.go @@ -819,11 +819,11 @@ func newFutureError(err error) chan *Response { return responseChan } -// receiveFuture receives from the passed futureResult channel to extract a +// ReceiveFuture receives from the passed futureResult channel to extract a // reply or any errors. The examined errors include an error in the // futureResult and the error in the reply from the server. This will block // until the result is available on the passed channel. -func receiveFuture(f chan *Response) ([]byte, error) { +func ReceiveFuture(f chan *Response) ([]byte, error) { // Wait for a response on the returned channel. r := <-f return r.result, r.err @@ -929,7 +929,7 @@ func (c *Client) SendCmd(cmd interface{}) chan *Response { func (c *Client) SendCmdAndWait(cmd interface{}) (interface{}, error) { // Marshal the command to JSON-RPC, send it to the connected server, and // wait for a response on the returned channel. - return receiveFuture(c.SendCmd(cmd)) + return ReceiveFuture(c.SendCmd(cmd)) } // Disconnected returns whether or not the server is disconnected. If a diff --git a/rpcclient/mining.go b/rpcclient/mining.go index 27aa6558ea..bdbfc7c0c3 100644 --- a/rpcclient/mining.go +++ b/rpcclient/mining.go @@ -21,7 +21,7 @@ type FutureGenerateResult chan *Response // Receive waits for the Response promised by the future and returns a list of // block hashes generated by the call. func (r FutureGenerateResult) Receive() ([]*chainhash.Hash, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -68,7 +68,7 @@ type FutureGenerateToAddressResult chan *Response // Receive waits for the response promised by the future and returns the hashes of // of the generated blocks. func (f FutureGenerateToAddressResult) Receive() ([]*chainhash.Hash, error) { - res, err := receiveFuture(f) + res, err := ReceiveFuture(f) if err != nil { return nil, err } @@ -115,7 +115,7 @@ type FutureGetGenerateResult chan *Response // Receive waits for the Response promised by the future and returns true if the // server is set to mine, otherwise false. func (r FutureGetGenerateResult) Receive() (bool, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return false, err } @@ -152,7 +152,7 @@ type FutureSetGenerateResult chan *Response // Receive waits for the Response promised by the future and returns an error if // any occurred when setting the server to generate coins (mine) or not. func (r FutureSetGenerateResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -179,7 +179,7 @@ type FutureGetHashesPerSecResult chan *Response // hashes per second performance measurement while generating coins (mining). // Zero is returned if the server is not mining. func (r FutureGetHashesPerSecResult) Receive() (int64, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return -1, err } @@ -218,7 +218,7 @@ type FutureGetMiningInfoResult chan *Response // Receive waits for the Response promised by the future and returns the mining // information. func (r FutureGetMiningInfoResult) Receive() (*btcjson.GetMiningInfoResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -256,7 +256,7 @@ type FutureGetNetworkHashPS chan *Response // estimated network hashes per second for the block heights provided by the // parameters. func (r FutureGetNetworkHashPS) Receive() (int64, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return -1, err } @@ -338,7 +338,7 @@ type FutureGetWork chan *Response // Receive waits for the Response promised by the future and returns the hash // data to work on. func (r FutureGetWork) Receive() (*btcjson.GetWorkResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -377,7 +377,7 @@ type FutureGetWorkSubmit chan *Response // Receive waits for the Response promised by the future and returns whether // or not the submitted block header was accepted. func (r FutureGetWorkSubmit) Receive() (bool, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return false, err } @@ -417,7 +417,7 @@ type FutureSubmitBlockResult chan *Response // Receive waits for the Response promised by the future and returns an error if // any occurred when submitting the block. func (r FutureSubmitBlockResult) Receive() error { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return err } diff --git a/rpcclient/net.go b/rpcclient/net.go index 018873e438..62b9c27c2c 100644 --- a/rpcclient/net.go +++ b/rpcclient/net.go @@ -40,7 +40,7 @@ type FutureAddNodeResult chan *Response // Receive waits for the Response promised by the future and returns an error if // any occurred when performing the specified command. func (r FutureAddNodeResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -70,7 +70,7 @@ type FutureNodeResult chan *Response // Receive waits for the Response promised by the future and returns an error if // any occurred when performing the specified command. func (r FutureNodeResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -104,7 +104,7 @@ type FutureGetAddedNodeInfoResult chan *Response // Receive waits for the Response promised by the future and returns information // about manually added (persistent) peers. func (r FutureGetAddedNodeInfoResult) Receive() ([]btcjson.GetAddedNodeInfoResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -144,7 +144,7 @@ type FutureGetAddedNodeInfoNoDNSResult chan *Response // Receive waits for the Response promised by the future and returns a list of // manually added (persistent) peers. func (r FutureGetAddedNodeInfoNoDNSResult) Receive() ([]string, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -185,7 +185,7 @@ type FutureGetConnectionCountResult chan *Response // Receive waits for the Response promised by the future and returns the number // of active connections to other peers. func (r FutureGetConnectionCountResult) Receive() (int64, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return 0, err } @@ -222,7 +222,7 @@ type FuturePingResult chan *Response // Receive waits for the Response promised by the future and returns the result // of queueing a ping to be sent to each connected peer. func (r FuturePingResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -251,7 +251,7 @@ type FutureGetNetworkInfoResult chan *Response // Receive waits for the response promised by the future and returns data about // the current network. func (r FutureGetNetworkInfoResult) Receive() (*btcjson.GetNetworkInfoResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -288,7 +288,7 @@ type FutureGetPeerInfoResult chan *Response // Receive waits for the Response promised by the future and returns data about // each connected network peer. func (r FutureGetPeerInfoResult) Receive() ([]btcjson.GetPeerInfoResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -325,7 +325,7 @@ type FutureGetNetTotalsResult chan *Response // Receive waits for the Response promised by the future and returns network // traffic statistics. func (r FutureGetNetTotalsResult) Receive() (*btcjson.GetNetTotalsResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } diff --git a/rpcclient/notify.go b/rpcclient/notify.go index 8305657947..6879099acd 100644 --- a/rpcclient/notify.go +++ b/rpcclient/notify.go @@ -861,7 +861,7 @@ type FutureNotifyBlocksResult chan *Response // Receive waits for the Response promised by the future and returns an error // if the registration was not successful. func (r FutureNotifyBlocksResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -911,7 +911,7 @@ type FutureNotifySpentResult chan *Response // Receive waits for the Response promised by the future and returns an error // if the registration was not successful. func (r FutureNotifySpentResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -995,7 +995,7 @@ type FutureNotifyNewTransactionsResult chan *Response // Receive waits for the Response promised by the future and returns an error // if the registration was not successful. func (r FutureNotifyNewTransactionsResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -1046,7 +1046,7 @@ type FutureNotifyReceivedResult chan *Response // Receive waits for the Response promised by the future and returns an error // if the registration was not successful. func (r FutureNotifyReceivedResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -1132,7 +1132,7 @@ type FutureRescanResult chan *Response // Receive waits for the Response promised by the future and returns an error // if the rescan was not successful. func (r FutureRescanResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -1315,7 +1315,7 @@ type FutureLoadTxFilterResult chan *Response // NOTE: This is a btcd extension ported from github.com/decred/dcrrpcclient // and requires a websocket connection. func (r FutureLoadTxFilterResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } diff --git a/rpcclient/rawrequest.go b/rpcclient/rawrequest.go index 28c39dd37c..8ab05deb84 100644 --- a/rpcclient/rawrequest.go +++ b/rpcclient/rawrequest.go @@ -18,7 +18,7 @@ type FutureRawResult chan *Response // Receive waits for the Response promised by the future and returns the raw // response, or an error if the request was unsuccessful. func (r FutureRawResult) Receive() (json.RawMessage, error) { - return receiveFuture(r) + return ReceiveFuture(r) } // RawRequestAsync returns an instance of a type that can be used to get the diff --git a/rpcclient/rawtransactions.go b/rpcclient/rawtransactions.go index e85bb078c5..f7c14212da 100644 --- a/rpcclient/rawtransactions.go +++ b/rpcclient/rawtransactions.go @@ -71,7 +71,7 @@ type FutureGetRawTransactionResult chan *Response // Receive waits for the Response promised by the future and returns a // transaction given its hash. func (r FutureGetRawTransactionResult) Receive() (*btcutil.Tx, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -128,7 +128,7 @@ type FutureGetRawTransactionVerboseResult chan *Response // Receive waits for the Response promised by the future and returns information // about a transaction given its hash. func (r FutureGetRawTransactionVerboseResult) Receive() (*btcjson.TxRawResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -173,7 +173,7 @@ type FutureDecodeRawTransactionResult chan *Response // Receive waits for the Response promised by the future and returns information // about a transaction given its serialized bytes. func (r FutureDecodeRawTransactionResult) Receive() (*btcjson.TxRawResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -213,7 +213,7 @@ type FutureCreateRawTransactionResult chan *Response // transaction spending the provided inputs and sending to the provided // addresses. func (r FutureCreateRawTransactionResult) Receive() (*wire.MsgTx, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -276,7 +276,7 @@ type FutureSendRawTransactionResult chan *Response // of submitting the encoded transaction to the server which then relays it to // the network. func (r FutureSendRawTransactionResult) Receive() (*chainhash.Hash, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -349,7 +349,7 @@ type FutureSignRawTransactionResult chan *Response // Receive waits for the Response promised by the future and returns the // signed transaction as well as whether or not all inputs are now signed. func (r FutureSignRawTransactionResult) Receive() (*wire.MsgTx, bool, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, false, err } @@ -547,7 +547,7 @@ type FutureSearchRawTransactionsResult chan *Response // Receive waits for the Response promised by the future and returns the // found raw transactions. func (r FutureSearchRawTransactionsResult) Receive() ([]*wire.MsgTx, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -612,7 +612,7 @@ type FutureSearchRawTransactionsVerboseResult chan *Response // Receive waits for the Response promised by the future and returns the // found raw transactions. func (r FutureSearchRawTransactionsVerboseResult) Receive() ([]*btcjson.SearchRawTransactionsResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -667,7 +667,7 @@ type FutureDecodeScriptResult chan *Response // Receive waits for the Response promised by the future and returns information // about a script given its serialized bytes. func (r FutureDecodeScriptResult) Receive() (*btcjson.DecodeScriptResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } diff --git a/rpcclient/wallet.go b/rpcclient/wallet.go index b678cd0bfb..b08bd2836a 100644 --- a/rpcclient/wallet.go +++ b/rpcclient/wallet.go @@ -26,7 +26,7 @@ type FutureGetTransactionResult chan *Response // Receive waits for the Response promised by the future and returns detailed // information about a wallet transaction. func (r FutureGetTransactionResult) Receive() (*btcjson.GetTransactionResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -71,7 +71,7 @@ type FutureListTransactionsResult chan *Response // Receive waits for the Response promised by the future and returns a list of // the most recent transactions. func (r FutureListTransactionsResult) Receive() ([]btcjson.ListTransactionsResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -152,7 +152,7 @@ type FutureListUnspentResult chan *Response // or ListUnspentMinMaxAddressesAsync, the range may be limited by the // parameters of the RPC invocation. func (r FutureListUnspentResult) Receive() ([]btcjson.ListUnspentResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -249,7 +249,7 @@ type FutureListSinceBlockResult chan *Response // transactions added in blocks since the specified block hash, or all // transactions if it is nil. func (r FutureListSinceBlockResult) Receive() (*btcjson.ListSinceBlockResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -323,7 +323,7 @@ type FutureLockUnspentResult chan *Response // Receive waits for the Response promised by the future and returns the result // of locking or unlocking the unspent output(s). func (r FutureLockUnspentResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -372,7 +372,7 @@ type FutureListLockUnspentResult chan *Response // Receive waits for the Response promised by the future and returns the result // of all currently locked unspent outputs. func (r FutureListLockUnspentResult) Receive() ([]*wire.OutPoint, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -422,7 +422,7 @@ type FutureSetTxFeeResult chan *Response // of setting an optional transaction fee per KB that helps ensure transactions // are processed quickly. Most transaction are 1KB. func (r FutureSetTxFeeResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -449,7 +449,7 @@ type FutureSendToAddressResult chan *Response // Receive waits for the Response promised by the future and returns the hash // of the transaction sending the passed amount to the given address. func (r FutureSendToAddressResult) Receive() (*chainhash.Hash, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -528,7 +528,7 @@ type FutureSendFromResult chan *Response // of the transaction sending amount to the given address using the provided // account as a source of funds. func (r FutureSendFromResult) Receive() (*chainhash.Hash, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -636,7 +636,7 @@ type FutureSendManyResult chan *Response // of the transaction sending multiple amounts to multiple addresses using the // provided account as a source of funds. func (r FutureSendManyResult) Receive() (*chainhash.Hash, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -762,7 +762,7 @@ type FutureAddMultisigAddressResult struct { // multisignature address that requires the specified number of signatures for // the provided addresses. func (r FutureAddMultisigAddressResult) Receive() (btcutil.Address, error) { - res, err := receiveFuture(r.responseChannel) + res, err := ReceiveFuture(r.responseChannel) if err != nil { return nil, err } @@ -809,7 +809,7 @@ type FutureCreateMultisigResult chan *Response // Receive waits for the Response promised by the future and returns the // multisignature address and script needed to redeem it. func (r FutureCreateMultisigResult) Receive() (*btcjson.CreateMultiSigResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -853,7 +853,7 @@ type FutureCreateNewAccountResult chan *Response // Receive waits for the Response promised by the future and returns the // result of creating new account. func (r FutureCreateNewAccountResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -882,7 +882,7 @@ type FutureGetNewAddressResult struct { // Receive waits for the Response promised by the future and returns a new // address. func (r FutureGetNewAddressResult) Receive() (btcutil.Address, error) { - res, err := receiveFuture(r.responseChannel) + res, err := ReceiveFuture(r.responseChannel) if err != nil { return nil, err } @@ -928,7 +928,7 @@ type FutureGetRawChangeAddressResult struct { // address for receiving change that will be associated with the provided // account. Note that this is only for raw transactions and NOT for normal use. func (r FutureGetRawChangeAddressResult) Receive() (btcutil.Address, error) { - res, err := receiveFuture(r.responseChannel) + res, err := ReceiveFuture(r.responseChannel) if err != nil { return nil, err } @@ -974,7 +974,7 @@ type FutureAddWitnessAddressResult struct { // Receive waits for the Response promised by the future and returns the new // address. func (r FutureAddWitnessAddressResult) Receive() (btcutil.Address, error) { - res, err := receiveFuture(r.responseChannel) + res, err := ReceiveFuture(r.responseChannel) if err != nil { return nil, err } @@ -1019,7 +1019,7 @@ type FutureGetAccountAddressResult struct { // Receive waits for the Response promised by the future and returns the current // Bitcoin address for receiving payments to the specified account. func (r FutureGetAccountAddressResult) Receive() (btcutil.Address, error) { - res, err := receiveFuture(r.responseChannel) + res, err := ReceiveFuture(r.responseChannel) if err != nil { return nil, err } @@ -1061,7 +1061,7 @@ type FutureGetAccountResult chan *Response // Receive waits for the Response promised by the future and returns the account // associated with the passed address. func (r FutureGetAccountResult) Receive() (string, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return "", err } @@ -1099,7 +1099,7 @@ type FutureSetAccountResult chan *Response // Receive waits for the Response promised by the future and returns the result // of setting the account to be associated with the passed address. func (r FutureSetAccountResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -1129,7 +1129,7 @@ type FutureGetAddressesByAccountResult struct { // Receive waits for the Response promised by the future and returns the list of // addresses associated with the passed account. func (r FutureGetAddressesByAccountResult) Receive() ([]btcutil.Address, error) { - res, err := receiveFuture(r.responseChannel) + res, err := ReceiveFuture(r.responseChannel) if err != nil { return nil, err } @@ -1180,7 +1180,7 @@ type FutureMoveResult chan *Response // Receive waits for the Response promised by the future and returns the result // of the move operation. func (r FutureMoveResult) Receive() (bool, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return false, err } @@ -1270,7 +1270,7 @@ type FutureRenameAccountResult chan *Response // Receive waits for the Response promised by the future and returns the // result of creating new account. func (r FutureRenameAccountResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -1296,7 +1296,7 @@ type FutureValidateAddressResult chan *Response // Receive waits for the Response promised by the future and returns information // about the given bitcoin address. func (r FutureValidateAddressResult) Receive() (*btcjson.ValidateAddressWalletResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -1334,7 +1334,7 @@ type FutureKeyPoolRefillResult chan *Response // Receive waits for the Response promised by the future and returns the result // of refilling the key pool. func (r FutureKeyPoolRefillResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -1383,7 +1383,7 @@ type FutureListAccountsResult chan *Response // Receive waits for the Response promised by the future and returns returns a // map of account names and their associated balances. func (r FutureListAccountsResult) Receive() (map[string]btcutil.Amount, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -1452,7 +1452,7 @@ type FutureGetBalanceResult chan *Response // Receive waits for the Response promised by the future and returns the // available balance from the server for the specified account. func (r FutureGetBalanceResult) Receive() (btcutil.Amount, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return 0, err } @@ -1481,7 +1481,7 @@ type FutureGetBalanceParseResult chan *Response // Receive waits for the Response promised by the future and returns the // available balance from the server for the specified account. func (r FutureGetBalanceParseResult) Receive() (btcutil.Amount, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return 0, err } @@ -1555,7 +1555,7 @@ type FutureGetReceivedByAccountResult chan *Response // Receive waits for the Response promised by the future and returns the total // amount received with the specified account. func (r FutureGetReceivedByAccountResult) Receive() (btcutil.Amount, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return 0, err } @@ -1620,7 +1620,7 @@ type FutureGetUnconfirmedBalanceResult chan *Response // Receive waits for the Response promised by the future and returns returns the // unconfirmed balance from the server for the specified account. func (r FutureGetUnconfirmedBalanceResult) Receive() (btcutil.Amount, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return 0, err } @@ -1664,7 +1664,7 @@ type FutureGetReceivedByAddressResult chan *Response // Receive waits for the Response promised by the future and returns the total // amount received by the specified address. func (r FutureGetReceivedByAddressResult) Receive() (btcutil.Amount, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return 0, err } @@ -1733,7 +1733,7 @@ type FutureListReceivedByAccountResult chan *Response // Receive waits for the Response promised by the future and returns a list of // balances by account. func (r FutureListReceivedByAccountResult) Receive() ([]btcjson.ListReceivedByAccountResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -1820,7 +1820,7 @@ type FutureListReceivedByAddressResult chan *Response // Receive waits for the Response promised by the future and returns a list of // balances by address. func (r FutureListReceivedByAddressResult) Receive() ([]btcjson.ListReceivedByAddressResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -1909,7 +1909,7 @@ type FutureWalletLockResult chan *Response // Receive waits for the Response promised by the future and returns the result // of locking the wallet. func (r FutureWalletLockResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -1948,7 +1948,7 @@ type FutureWalletPassphraseChangeResult chan *Response // Receive waits for the Response promised by the future and returns the result // of changing the wallet passphrase. func (r FutureWalletPassphraseChangeResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -1979,7 +1979,7 @@ type FutureSignMessageResult chan *Response // Receive waits for the Response promised by the future and returns the message // signed with the private key of the specified address. func (r FutureSignMessageResult) Receive() (string, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return "", err } @@ -2020,7 +2020,7 @@ type FutureVerifyMessageResult chan *Response // Receive waits for the Response promised by the future and returns whether or // not the message was successfully verified. func (r FutureVerifyMessageResult) Receive() (bool, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return false, err } @@ -2066,7 +2066,7 @@ type FutureDumpPrivKeyResult chan *Response // key corresponding to the passed address encoded in the wallet import format // (WIF) func (r FutureDumpPrivKeyResult) Receive() (*btcutil.WIF, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err } @@ -2108,7 +2108,7 @@ type FutureImportAddressResult chan *Response // Receive waits for the Response promised by the future and returns the result // of importing the passed public address. func (r FutureImportAddressResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -2151,7 +2151,7 @@ type FutureImportPrivKeyResult chan *Response // of importing the passed private key which must be the wallet import format // (WIF). func (r FutureImportPrivKeyResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -2226,7 +2226,7 @@ type FutureImportPubKeyResult chan *Response // Receive waits for the Response promised by the future and returns the result // of importing the passed public key. func (r FutureImportPubKeyResult) Receive() error { - _, err := receiveFuture(r) + _, err := ReceiveFuture(r) return err } @@ -2275,7 +2275,7 @@ type FutureGetInfoResult chan *Response // Receive waits for the Response promised by the future and returns the info // provided by the server. func (r FutureGetInfoResult) Receive() (*btcjson.InfoWalletResult, error) { - res, err := receiveFuture(r) + res, err := ReceiveFuture(r) if err != nil { return nil, err }