id
int32
0
167k
repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
list
docstring
stringlengths
6
2.61k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
85
252
162,800
btcsuite/btcd
blockchain/indexers/txindex.go
Init
func (idx *TxIndex) Init() error { // Find the latest known block id field for the internal block id // index and initialize it. This is done because it's a lot more // efficient to do a single search at initialize time than it is to // write another value to the database on every update. err := idx.db.View(func(...
go
func (idx *TxIndex) Init() error { // Find the latest known block id field for the internal block id // index and initialize it. This is done because it's a lot more // efficient to do a single search at initialize time than it is to // write another value to the database on every update. err := idx.db.View(func(...
[ "func", "(", "idx", "*", "TxIndex", ")", "Init", "(", ")", "error", "{", "// Find the latest known block id field for the internal block id", "// index and initialize it. This is done because it's a lot more", "// efficient to do a single search at initialize time than it is to", "// wr...
// Init initializes the hash-based transaction index. In particular, it finds // the highest used block ID and stores it for later use when connecting or // disconnecting blocks. // // This is part of the Indexer interface.
[ "Init", "initializes", "the", "hash", "-", "based", "transaction", "index", ".", "In", "particular", "it", "finds", "the", "highest", "used", "block", "ID", "and", "stores", "it", "for", "later", "use", "when", "connecting", "or", "disconnecting", "blocks", ...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/indexers/txindex.go#L297-L353
162,801
btcsuite/btcd
blockchain/indexers/txindex.go
Create
func (idx *TxIndex) Create(dbTx database.Tx) error { meta := dbTx.Metadata() if _, err := meta.CreateBucket(idByHashIndexBucketName); err != nil { return err } if _, err := meta.CreateBucket(hashByIDIndexBucketName); err != nil { return err } _, err := meta.CreateBucket(txIndexKey) return err }
go
func (idx *TxIndex) Create(dbTx database.Tx) error { meta := dbTx.Metadata() if _, err := meta.CreateBucket(idByHashIndexBucketName); err != nil { return err } if _, err := meta.CreateBucket(hashByIDIndexBucketName); err != nil { return err } _, err := meta.CreateBucket(txIndexKey) return err }
[ "func", "(", "idx", "*", "TxIndex", ")", "Create", "(", "dbTx", "database", ".", "Tx", ")", "error", "{", "meta", ":=", "dbTx", ".", "Metadata", "(", ")", "\n", "if", "_", ",", "err", ":=", "meta", ".", "CreateBucket", "(", "idByHashIndexBucketName", ...
// Create is invoked when the indexer manager determines the index needs // to be created for the first time. It creates the buckets for the hash-based // transaction index and the internal block ID indexes. // // This is part of the Indexer interface.
[ "Create", "is", "invoked", "when", "the", "indexer", "manager", "determines", "the", "index", "needs", "to", "be", "created", "for", "the", "first", "time", ".", "It", "creates", "the", "buckets", "for", "the", "hash", "-", "based", "transaction", "index", ...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/indexers/txindex.go#L374-L384
162,802
btcsuite/btcd
blockchain/indexers/txindex.go
ConnectBlock
func (idx *TxIndex) ConnectBlock(dbTx database.Tx, block *btcutil.Block, stxos []blockchain.SpentTxOut) error { // Increment the internal block ID to use for the block being connected // and add all of the transactions in the block to the index. newBlockID := idx.curBlockID + 1 if err := dbAddTxIndexEntries(dbTx,...
go
func (idx *TxIndex) ConnectBlock(dbTx database.Tx, block *btcutil.Block, stxos []blockchain.SpentTxOut) error { // Increment the internal block ID to use for the block being connected // and add all of the transactions in the block to the index. newBlockID := idx.curBlockID + 1 if err := dbAddTxIndexEntries(dbTx,...
[ "func", "(", "idx", "*", "TxIndex", ")", "ConnectBlock", "(", "dbTx", "database", ".", "Tx", ",", "block", "*", "btcutil", ".", "Block", ",", "stxos", "[", "]", "blockchain", ".", "SpentTxOut", ")", "error", "{", "// Increment the internal block ID to use for ...
// ConnectBlock is invoked by the index manager when a new block has been // connected to the main chain. This indexer adds a hash-to-transaction mapping // for every transaction in the passed block. // // This is part of the Indexer interface.
[ "ConnectBlock", "is", "invoked", "by", "the", "index", "manager", "when", "a", "new", "block", "has", "been", "connected", "to", "the", "main", "chain", ".", "This", "indexer", "adds", "a", "hash", "-", "to", "-", "transaction", "mapping", "for", "every", ...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/indexers/txindex.go#L391-L409
162,803
btcsuite/btcd
blockchain/indexers/txindex.go
DisconnectBlock
func (idx *TxIndex) DisconnectBlock(dbTx database.Tx, block *btcutil.Block, stxos []blockchain.SpentTxOut) error { // Remove all of the transactions in the block from the index. if err := dbRemoveTxIndexEntries(dbTx, block); err != nil { return err } // Remove the block ID index entry for the block being disco...
go
func (idx *TxIndex) DisconnectBlock(dbTx database.Tx, block *btcutil.Block, stxos []blockchain.SpentTxOut) error { // Remove all of the transactions in the block from the index. if err := dbRemoveTxIndexEntries(dbTx, block); err != nil { return err } // Remove the block ID index entry for the block being disco...
[ "func", "(", "idx", "*", "TxIndex", ")", "DisconnectBlock", "(", "dbTx", "database", ".", "Tx", ",", "block", "*", "btcutil", ".", "Block", ",", "stxos", "[", "]", "blockchain", ".", "SpentTxOut", ")", "error", "{", "// Remove all of the transactions in the bl...
// DisconnectBlock is invoked by the index manager when a block has been // disconnected from the main chain. This indexer removes the // hash-to-transaction mapping for every transaction in the block. // // This is part of the Indexer interface.
[ "DisconnectBlock", "is", "invoked", "by", "the", "index", "manager", "when", "a", "block", "has", "been", "disconnected", "from", "the", "main", "chain", ".", "This", "indexer", "removes", "the", "hash", "-", "to", "-", "transaction", "mapping", "for", "ever...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/indexers/txindex.go#L416-L431
162,804
btcsuite/btcd
blockchain/indexers/txindex.go
TxBlockRegion
func (idx *TxIndex) TxBlockRegion(hash *chainhash.Hash) (*database.BlockRegion, error) { var region *database.BlockRegion err := idx.db.View(func(dbTx database.Tx) error { var err error region, err = dbFetchTxIndexEntry(dbTx, hash) return err }) return region, err }
go
func (idx *TxIndex) TxBlockRegion(hash *chainhash.Hash) (*database.BlockRegion, error) { var region *database.BlockRegion err := idx.db.View(func(dbTx database.Tx) error { var err error region, err = dbFetchTxIndexEntry(dbTx, hash) return err }) return region, err }
[ "func", "(", "idx", "*", "TxIndex", ")", "TxBlockRegion", "(", "hash", "*", "chainhash", ".", "Hash", ")", "(", "*", "database", ".", "BlockRegion", ",", "error", ")", "{", "var", "region", "*", "database", ".", "BlockRegion", "\n", "err", ":=", "idx",...
// TxBlockRegion returns the block region for the provided transaction hash // from the transaction index. The block region can in turn be used to load the // raw transaction bytes. When there is no entry for the provided hash, nil // will be returned for the both the entry and the error. // // This function is safe ...
[ "TxBlockRegion", "returns", "the", "block", "region", "for", "the", "provided", "transaction", "hash", "from", "the", "transaction", "index", ".", "The", "block", "region", "can", "in", "turn", "be", "used", "to", "load", "the", "raw", "transaction", "bytes", ...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/indexers/txindex.go#L439-L447
162,805
btcsuite/btcd
blockchain/indexers/txindex.go
dropBlockIDIndex
func dropBlockIDIndex(db database.DB) error { return db.Update(func(dbTx database.Tx) error { meta := dbTx.Metadata() err := meta.DeleteBucket(idByHashIndexBucketName) if err != nil { return err } return meta.DeleteBucket(hashByIDIndexBucketName) }) }
go
func dropBlockIDIndex(db database.DB) error { return db.Update(func(dbTx database.Tx) error { meta := dbTx.Metadata() err := meta.DeleteBucket(idByHashIndexBucketName) if err != nil { return err } return meta.DeleteBucket(hashByIDIndexBucketName) }) }
[ "func", "dropBlockIDIndex", "(", "db", "database", ".", "DB", ")", "error", "{", "return", "db", ".", "Update", "(", "func", "(", "dbTx", "database", ".", "Tx", ")", "error", "{", "meta", ":=", "dbTx", ".", "Metadata", "(", ")", "\n", "err", ":=", ...
// dropBlockIDIndex drops the internal block id index.
[ "dropBlockIDIndex", "drops", "the", "internal", "block", "id", "index", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/indexers/txindex.go#L461-L471
162,806
btcsuite/btcd
blockchain/indexers/txindex.go
DropTxIndex
func DropTxIndex(db database.DB, interrupt <-chan struct{}) error { err := dropIndex(db, addrIndexKey, addrIndexName, interrupt) if err != nil { return err } return dropIndex(db, txIndexKey, txIndexName, interrupt) }
go
func DropTxIndex(db database.DB, interrupt <-chan struct{}) error { err := dropIndex(db, addrIndexKey, addrIndexName, interrupt) if err != nil { return err } return dropIndex(db, txIndexKey, txIndexName, interrupt) }
[ "func", "DropTxIndex", "(", "db", "database", ".", "DB", ",", "interrupt", "<-", "chan", "struct", "{", "}", ")", "error", "{", "err", ":=", "dropIndex", "(", "db", ",", "addrIndexKey", ",", "addrIndexName", ",", "interrupt", ")", "\n", "if", "err", "!...
// DropTxIndex drops the transaction index from the provided database if it // exists. Since the address index relies on it, the address index will also be // dropped when it exists.
[ "DropTxIndex", "drops", "the", "transaction", "index", "from", "the", "provided", "database", "if", "it", "exists", ".", "Since", "the", "address", "index", "relies", "on", "it", "the", "address", "index", "will", "also", "be", "dropped", "when", "it", "exis...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/indexers/txindex.go#L476-L483
162,807
btcsuite/btcd
database/ffldb/ldbtreapiter.go
newLdbTreapIter
func newLdbTreapIter(tx *transaction, slice *util.Range) *ldbTreapIter { iter := tx.pendingKeys.Iterator(slice.Start, slice.Limit) tx.addActiveIter(iter) return &ldbTreapIter{Iterator: iter, tx: tx} }
go
func newLdbTreapIter(tx *transaction, slice *util.Range) *ldbTreapIter { iter := tx.pendingKeys.Iterator(slice.Start, slice.Limit) tx.addActiveIter(iter) return &ldbTreapIter{Iterator: iter, tx: tx} }
[ "func", "newLdbTreapIter", "(", "tx", "*", "transaction", ",", "slice", "*", "util", ".", "Range", ")", "*", "ldbTreapIter", "{", "iter", ":=", "tx", ".", "pendingKeys", ".", "Iterator", "(", "slice", ".", "Start", ",", "slice", ".", "Limit", ")", "\n"...
// newLdbTreapIter creates a new treap iterator for the given slice against the // pending keys for the passed transaction and returns it wrapped in an // ldbTreapIter so it can be used as a leveldb iterator. It also adds the new // iterator to the list of active iterators for the transaction.
[ "newLdbTreapIter", "creates", "a", "new", "treap", "iterator", "for", "the", "given", "slice", "against", "the", "pending", "keys", "for", "the", "passed", "transaction", "and", "returns", "it", "wrapped", "in", "an", "ldbTreapIter", "so", "it", "can", "be", ...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/database/ffldb/ldbtreapiter.go#L54-L58
162,808
btcsuite/btcd
btcjson/walletsvrwscmds.go
NewExportWatchingWalletCmd
func NewExportWatchingWalletCmd(account *string, download *bool) *ExportWatchingWalletCmd { return &ExportWatchingWalletCmd{ Account: account, Download: download, } }
go
func NewExportWatchingWalletCmd(account *string, download *bool) *ExportWatchingWalletCmd { return &ExportWatchingWalletCmd{ Account: account, Download: download, } }
[ "func", "NewExportWatchingWalletCmd", "(", "account", "*", "string", ",", "download", "*", "bool", ")", "*", "ExportWatchingWalletCmd", "{", "return", "&", "ExportWatchingWalletCmd", "{", "Account", ":", "account", ",", "Download", ":", "download", ",", "}", "\n...
// NewExportWatchingWalletCmd returns a new instance which can be used to issue // a exportwatchingwallet JSON-RPC command. // // The parameters which are pointers indicate they are optional. Passing nil // for optional parameters will use the default value.
[ "NewExportWatchingWalletCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "exportwatchingwallet", "JSON", "-", "RPC", "command", ".", "The", "parameters", "which", "are", "pointers", "indicate", "they", "are", "optional", ...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrwscmds.go#L34-L39
162,809
btcsuite/btcd
btcjson/walletsvrwscmds.go
NewListAddressTransactionsCmd
func NewListAddressTransactionsCmd(addresses []string, account *string) *ListAddressTransactionsCmd { return &ListAddressTransactionsCmd{ Addresses: addresses, Account: account, } }
go
func NewListAddressTransactionsCmd(addresses []string, account *string) *ListAddressTransactionsCmd { return &ListAddressTransactionsCmd{ Addresses: addresses, Account: account, } }
[ "func", "NewListAddressTransactionsCmd", "(", "addresses", "[", "]", "string", ",", "account", "*", "string", ")", "*", "ListAddressTransactionsCmd", "{", "return", "&", "ListAddressTransactionsCmd", "{", "Addresses", ":", "addresses", ",", "Account", ":", "account"...
// NewListAddressTransactionsCmd returns a new instance which can be used to // issue a listaddresstransactions JSON-RPC command. // // The parameters which are pointers indicate they are optional. Passing nil // for optional parameters will use the default value.
[ "NewListAddressTransactionsCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "listaddresstransactions", "JSON", "-", "RPC", "command", ".", "The", "parameters", "which", "are", "pointers", "indicate", "they", "are", "option...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrwscmds.go#L69-L74
162,810
btcsuite/btcd
btcjson/walletsvrwscmds.go
NewRecoverAddressesCmd
func NewRecoverAddressesCmd(account string, n int) *RecoverAddressesCmd { return &RecoverAddressesCmd{ Account: account, N: n, } }
go
func NewRecoverAddressesCmd(account string, n int) *RecoverAddressesCmd { return &RecoverAddressesCmd{ Account: account, N: n, } }
[ "func", "NewRecoverAddressesCmd", "(", "account", "string", ",", "n", "int", ")", "*", "RecoverAddressesCmd", "{", "return", "&", "RecoverAddressesCmd", "{", "Account", ":", "account", ",", "N", ":", "n", ",", "}", "\n", "}" ]
// NewRecoverAddressesCmd returns a new instance which can be used to issue a // recoveraddresses JSON-RPC command.
[ "NewRecoverAddressesCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "recoveraddresses", "JSON", "-", "RPC", "command", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrwscmds.go#L100-L105
162,811
btcsuite/btcd
blockchain/merkle.go
nextPowerOfTwo
func nextPowerOfTwo(n int) int { // Return the number if it's already a power of 2. if n&(n-1) == 0 { return n } // Figure out and return the next power of two. exponent := uint(math.Log2(float64(n))) + 1 return 1 << exponent // 2^exponent }
go
func nextPowerOfTwo(n int) int { // Return the number if it's already a power of 2. if n&(n-1) == 0 { return n } // Figure out and return the next power of two. exponent := uint(math.Log2(float64(n))) + 1 return 1 << exponent // 2^exponent }
[ "func", "nextPowerOfTwo", "(", "n", "int", ")", "int", "{", "// Return the number if it's already a power of 2.", "if", "n", "&", "(", "n", "-", "1", ")", "==", "0", "{", "return", "n", "\n", "}", "\n\n", "// Figure out and return the next power of two.", "exponen...
// nextPowerOfTwo returns the next highest power of two from a given number if // it is not already a power of two. This is a helper function used during the // calculation of a merkle tree.
[ "nextPowerOfTwo", "returns", "the", "next", "highest", "power", "of", "two", "from", "a", "given", "number", "if", "it", "is", "not", "already", "a", "power", "of", "two", ".", "This", "is", "a", "helper", "function", "used", "during", "the", "calculation"...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/merkle.go#L47-L56
162,812
btcsuite/btcd
blockchain/merkle.go
HashMerkleBranches
func HashMerkleBranches(left *chainhash.Hash, right *chainhash.Hash) *chainhash.Hash { // Concatenate the left and right nodes. var hash [chainhash.HashSize * 2]byte copy(hash[:chainhash.HashSize], left[:]) copy(hash[chainhash.HashSize:], right[:]) newHash := chainhash.DoubleHashH(hash[:]) return &newHash }
go
func HashMerkleBranches(left *chainhash.Hash, right *chainhash.Hash) *chainhash.Hash { // Concatenate the left and right nodes. var hash [chainhash.HashSize * 2]byte copy(hash[:chainhash.HashSize], left[:]) copy(hash[chainhash.HashSize:], right[:]) newHash := chainhash.DoubleHashH(hash[:]) return &newHash }
[ "func", "HashMerkleBranches", "(", "left", "*", "chainhash", ".", "Hash", ",", "right", "*", "chainhash", ".", "Hash", ")", "*", "chainhash", ".", "Hash", "{", "// Concatenate the left and right nodes.", "var", "hash", "[", "chainhash", ".", "HashSize", "*", "...
// HashMerkleBranches takes two hashes, treated as the left and right tree // nodes, and returns the hash of their concatenation. This is a helper // function used to aid in the generation of a merkle tree.
[ "HashMerkleBranches", "takes", "two", "hashes", "treated", "as", "the", "left", "and", "right", "tree", "nodes", "and", "returns", "the", "hash", "of", "their", "concatenation", ".", "This", "is", "a", "helper", "function", "used", "to", "aid", "in", "the", ...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/merkle.go#L61-L69
162,813
btcsuite/btcd
btcjson/walletsvrcmds.go
NewAddMultisigAddressCmd
func NewAddMultisigAddressCmd(nRequired int, keys []string, account *string) *AddMultisigAddressCmd { return &AddMultisigAddressCmd{ NRequired: nRequired, Keys: keys, Account: account, } }
go
func NewAddMultisigAddressCmd(nRequired int, keys []string, account *string) *AddMultisigAddressCmd { return &AddMultisigAddressCmd{ NRequired: nRequired, Keys: keys, Account: account, } }
[ "func", "NewAddMultisigAddressCmd", "(", "nRequired", "int", ",", "keys", "[", "]", "string", ",", "account", "*", "string", ")", "*", "AddMultisigAddressCmd", "{", "return", "&", "AddMultisigAddressCmd", "{", "NRequired", ":", "nRequired", ",", "Keys", ":", "...
// NewAddMultisigAddressCmd returns a new instance which can be used to issue a // addmultisigaddress JSON-RPC command. // // The parameters which are pointers indicate they are optional. Passing nil // for optional parameters will use the default value.
[ "NewAddMultisigAddressCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "addmultisigaddress", "JSON", "-", "RPC", "command", ".", "The", "parameters", "which", "are", "pointers", "indicate", "they", "are", "optional", "."...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L22-L28
162,814
btcsuite/btcd
btcjson/walletsvrcmds.go
NewCreateMultisigCmd
func NewCreateMultisigCmd(nRequired int, keys []string) *CreateMultisigCmd { return &CreateMultisigCmd{ NRequired: nRequired, Keys: keys, } }
go
func NewCreateMultisigCmd(nRequired int, keys []string) *CreateMultisigCmd { return &CreateMultisigCmd{ NRequired: nRequired, Keys: keys, } }
[ "func", "NewCreateMultisigCmd", "(", "nRequired", "int", ",", "keys", "[", "]", "string", ")", "*", "CreateMultisigCmd", "{", "return", "&", "CreateMultisigCmd", "{", "NRequired", ":", "nRequired", ",", "Keys", ":", "keys", ",", "}", "\n", "}" ]
// NewCreateMultisigCmd returns a new instance which can be used to issue a // createmultisig JSON-RPC command.
[ "NewCreateMultisigCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "createmultisig", "JSON", "-", "RPC", "command", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L51-L56
162,815
btcsuite/btcd
btcjson/walletsvrcmds.go
NewGetBalanceCmd
func NewGetBalanceCmd(account *string, minConf *int) *GetBalanceCmd { return &GetBalanceCmd{ Account: account, MinConf: minConf, } }
go
func NewGetBalanceCmd(account *string, minConf *int) *GetBalanceCmd { return &GetBalanceCmd{ Account: account, MinConf: minConf, } }
[ "func", "NewGetBalanceCmd", "(", "account", "*", "string", ",", "minConf", "*", "int", ")", "*", "GetBalanceCmd", "{", "return", "&", "GetBalanceCmd", "{", "Account", ":", "account", ",", "MinConf", ":", "minConf", ",", "}", "\n", "}" ]
// NewGetBalanceCmd returns a new instance which can be used to issue a // getbalance JSON-RPC command. // // The parameters which are pointers indicate they are optional. Passing nil // for optional parameters will use the default value.
[ "NewGetBalanceCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "getbalance", "JSON", "-", "RPC", "command", ".", "The", "parameters", "which", "are", "pointers", "indicate", "they", "are", "optional", ".", "Passing", ...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L160-L165
162,816
btcsuite/btcd
btcjson/walletsvrcmds.go
NewGetReceivedByAccountCmd
func NewGetReceivedByAccountCmd(account string, minConf *int) *GetReceivedByAccountCmd { return &GetReceivedByAccountCmd{ Account: account, MinConf: minConf, } }
go
func NewGetReceivedByAccountCmd(account string, minConf *int) *GetReceivedByAccountCmd { return &GetReceivedByAccountCmd{ Account: account, MinConf: minConf, } }
[ "func", "NewGetReceivedByAccountCmd", "(", "account", "string", ",", "minConf", "*", "int", ")", "*", "GetReceivedByAccountCmd", "{", "return", "&", "GetReceivedByAccountCmd", "{", "Account", ":", "account", ",", "MinConf", ":", "minConf", ",", "}", "\n", "}" ]
// NewGetReceivedByAccountCmd returns a new instance which can be used to issue // a getreceivedbyaccount JSON-RPC command. // // The parameters which are pointers indicate they are optional. Passing nil // for optional parameters will use the default value.
[ "NewGetReceivedByAccountCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "getreceivedbyaccount", "JSON", "-", "RPC", "command", ".", "The", "parameters", "which", "are", "pointers", "indicate", "they", "are", "optional", ...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L210-L215
162,817
btcsuite/btcd
btcjson/walletsvrcmds.go
NewGetReceivedByAddressCmd
func NewGetReceivedByAddressCmd(address string, minConf *int) *GetReceivedByAddressCmd { return &GetReceivedByAddressCmd{ Address: address, MinConf: minConf, } }
go
func NewGetReceivedByAddressCmd(address string, minConf *int) *GetReceivedByAddressCmd { return &GetReceivedByAddressCmd{ Address: address, MinConf: minConf, } }
[ "func", "NewGetReceivedByAddressCmd", "(", "address", "string", ",", "minConf", "*", "int", ")", "*", "GetReceivedByAddressCmd", "{", "return", "&", "GetReceivedByAddressCmd", "{", "Address", ":", "address", ",", "MinConf", ":", "minConf", ",", "}", "\n", "}" ]
// NewGetReceivedByAddressCmd returns a new instance which can be used to issue // a getreceivedbyaddress JSON-RPC command. // // The parameters which are pointers indicate they are optional. Passing nil // for optional parameters will use the default value.
[ "NewGetReceivedByAddressCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "getreceivedbyaddress", "JSON", "-", "RPC", "command", ".", "The", "parameters", "which", "are", "pointers", "indicate", "they", "are", "optional", ...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L228-L233
162,818
btcsuite/btcd
btcjson/walletsvrcmds.go
NewGetTransactionCmd
func NewGetTransactionCmd(txHash string, includeWatchOnly *bool) *GetTransactionCmd { return &GetTransactionCmd{ Txid: txHash, IncludeWatchOnly: includeWatchOnly, } }
go
func NewGetTransactionCmd(txHash string, includeWatchOnly *bool) *GetTransactionCmd { return &GetTransactionCmd{ Txid: txHash, IncludeWatchOnly: includeWatchOnly, } }
[ "func", "NewGetTransactionCmd", "(", "txHash", "string", ",", "includeWatchOnly", "*", "bool", ")", "*", "GetTransactionCmd", "{", "return", "&", "GetTransactionCmd", "{", "Txid", ":", "txHash", ",", "IncludeWatchOnly", ":", "includeWatchOnly", ",", "}", "\n", "...
// NewGetTransactionCmd returns a new instance which can be used to issue a // gettransaction JSON-RPC command. // // The parameters which are pointers indicate they are optional. Passing nil // for optional parameters will use the default value.
[ "NewGetTransactionCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "gettransaction", "JSON", "-", "RPC", "command", ".", "The", "parameters", "which", "are", "pointers", "indicate", "they", "are", "optional", ".", "Pas...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L246-L251
162,819
btcsuite/btcd
btcjson/walletsvrcmds.go
NewImportPrivKeyCmd
func NewImportPrivKeyCmd(privKey string, label *string, rescan *bool) *ImportPrivKeyCmd { return &ImportPrivKeyCmd{ PrivKey: privKey, Label: label, Rescan: rescan, } }
go
func NewImportPrivKeyCmd(privKey string, label *string, rescan *bool) *ImportPrivKeyCmd { return &ImportPrivKeyCmd{ PrivKey: privKey, Label: label, Rescan: rescan, } }
[ "func", "NewImportPrivKeyCmd", "(", "privKey", "string", ",", "label", "*", "string", ",", "rescan", "*", "bool", ")", "*", "ImportPrivKeyCmd", "{", "return", "&", "ImportPrivKeyCmd", "{", "PrivKey", ":", "privKey", ",", "Label", ":", "label", ",", "Rescan",...
// NewImportPrivKeyCmd returns a new instance which can be used to issue a // importprivkey JSON-RPC command. // // The parameters which are pointers indicate they are optional. Passing nil // for optional parameters will use the default value.
[ "NewImportPrivKeyCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "importprivkey", "JSON", "-", "RPC", "command", ".", "The", "parameters", "which", "are", "pointers", "indicate", "they", "are", "optional", ".", "Passi...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L274-L280
162,820
btcsuite/btcd
btcjson/walletsvrcmds.go
NewListReceivedByAccountCmd
func NewListReceivedByAccountCmd(minConf *int, includeEmpty, includeWatchOnly *bool) *ListReceivedByAccountCmd { return &ListReceivedByAccountCmd{ MinConf: minConf, IncludeEmpty: includeEmpty, IncludeWatchOnly: includeWatchOnly, } }
go
func NewListReceivedByAccountCmd(minConf *int, includeEmpty, includeWatchOnly *bool) *ListReceivedByAccountCmd { return &ListReceivedByAccountCmd{ MinConf: minConf, IncludeEmpty: includeEmpty, IncludeWatchOnly: includeWatchOnly, } }
[ "func", "NewListReceivedByAccountCmd", "(", "minConf", "*", "int", ",", "includeEmpty", ",", "includeWatchOnly", "*", "bool", ")", "*", "ListReceivedByAccountCmd", "{", "return", "&", "ListReceivedByAccountCmd", "{", "MinConf", ":", "minConf", ",", "IncludeEmpty", "...
// NewListReceivedByAccountCmd returns a new instance which can be used to issue // a listreceivedbyaccount JSON-RPC command. // // The parameters which are pointers indicate they are optional. Passing nil // for optional parameters will use the default value.
[ "NewListReceivedByAccountCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "listreceivedbyaccount", "JSON", "-", "RPC", "command", ".", "The", "parameters", "which", "are", "pointers", "indicate", "they", "are", "optional",...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L344-L350
162,821
btcsuite/btcd
btcjson/walletsvrcmds.go
NewListReceivedByAddressCmd
func NewListReceivedByAddressCmd(minConf *int, includeEmpty, includeWatchOnly *bool) *ListReceivedByAddressCmd { return &ListReceivedByAddressCmd{ MinConf: minConf, IncludeEmpty: includeEmpty, IncludeWatchOnly: includeWatchOnly, } }
go
func NewListReceivedByAddressCmd(minConf *int, includeEmpty, includeWatchOnly *bool) *ListReceivedByAddressCmd { return &ListReceivedByAddressCmd{ MinConf: minConf, IncludeEmpty: includeEmpty, IncludeWatchOnly: includeWatchOnly, } }
[ "func", "NewListReceivedByAddressCmd", "(", "minConf", "*", "int", ",", "includeEmpty", ",", "includeWatchOnly", "*", "bool", ")", "*", "ListReceivedByAddressCmd", "{", "return", "&", "ListReceivedByAddressCmd", "{", "MinConf", ":", "minConf", ",", "IncludeEmpty", "...
// NewListReceivedByAddressCmd returns a new instance which can be used to issue // a listreceivedbyaddress JSON-RPC command. // // The parameters which are pointers indicate they are optional. Passing nil // for optional parameters will use the default value.
[ "NewListReceivedByAddressCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "listreceivedbyaddress", "JSON", "-", "RPC", "command", ".", "The", "parameters", "which", "are", "pointers", "indicate", "they", "are", "optional",...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L364-L370
162,822
btcsuite/btcd
btcjson/walletsvrcmds.go
NewListSinceBlockCmd
func NewListSinceBlockCmd(blockHash *string, targetConfirms *int, includeWatchOnly *bool) *ListSinceBlockCmd { return &ListSinceBlockCmd{ BlockHash: blockHash, TargetConfirmations: targetConfirms, IncludeWatchOnly: includeWatchOnly, } }
go
func NewListSinceBlockCmd(blockHash *string, targetConfirms *int, includeWatchOnly *bool) *ListSinceBlockCmd { return &ListSinceBlockCmd{ BlockHash: blockHash, TargetConfirmations: targetConfirms, IncludeWatchOnly: includeWatchOnly, } }
[ "func", "NewListSinceBlockCmd", "(", "blockHash", "*", "string", ",", "targetConfirms", "*", "int", ",", "includeWatchOnly", "*", "bool", ")", "*", "ListSinceBlockCmd", "{", "return", "&", "ListSinceBlockCmd", "{", "BlockHash", ":", "blockHash", ",", "TargetConfir...
// NewListSinceBlockCmd returns a new instance which can be used to issue a // listsinceblock JSON-RPC command. // // The parameters which are pointers indicate they are optional. Passing nil // for optional parameters will use the default value.
[ "NewListSinceBlockCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "listsinceblock", "JSON", "-", "RPC", "command", ".", "The", "parameters", "which", "are", "pointers", "indicate", "they", "are", "optional", ".", "Pas...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L384-L390
162,823
btcsuite/btcd
btcjson/walletsvrcmds.go
NewListTransactionsCmd
func NewListTransactionsCmd(account *string, count, from *int, includeWatchOnly *bool) *ListTransactionsCmd { return &ListTransactionsCmd{ Account: account, Count: count, From: from, IncludeWatchOnly: includeWatchOnly, } }
go
func NewListTransactionsCmd(account *string, count, from *int, includeWatchOnly *bool) *ListTransactionsCmd { return &ListTransactionsCmd{ Account: account, Count: count, From: from, IncludeWatchOnly: includeWatchOnly, } }
[ "func", "NewListTransactionsCmd", "(", "account", "*", "string", ",", "count", ",", "from", "*", "int", ",", "includeWatchOnly", "*", "bool", ")", "*", "ListTransactionsCmd", "{", "return", "&", "ListTransactionsCmd", "{", "Account", ":", "account", ",", "Coun...
// NewListTransactionsCmd returns a new instance which can be used to issue a // listtransactions JSON-RPC command. // // The parameters which are pointers indicate they are optional. Passing nil // for optional parameters will use the default value.
[ "NewListTransactionsCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "listtransactions", "JSON", "-", "RPC", "command", ".", "The", "parameters", "which", "are", "pointers", "indicate", "they", "are", "optional", ".", ...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L405-L412
162,824
btcsuite/btcd
btcjson/walletsvrcmds.go
NewListUnspentCmd
func NewListUnspentCmd(minConf, maxConf *int, addresses *[]string) *ListUnspentCmd { return &ListUnspentCmd{ MinConf: minConf, MaxConf: maxConf, Addresses: addresses, } }
go
func NewListUnspentCmd(minConf, maxConf *int, addresses *[]string) *ListUnspentCmd { return &ListUnspentCmd{ MinConf: minConf, MaxConf: maxConf, Addresses: addresses, } }
[ "func", "NewListUnspentCmd", "(", "minConf", ",", "maxConf", "*", "int", ",", "addresses", "*", "[", "]", "string", ")", "*", "ListUnspentCmd", "{", "return", "&", "ListUnspentCmd", "{", "MinConf", ":", "minConf", ",", "MaxConf", ":", "maxConf", ",", "Addr...
// NewListUnspentCmd returns a new instance which can be used to issue a // listunspent JSON-RPC command. // // The parameters which are pointers indicate they are optional. Passing nil // for optional parameters will use the default value.
[ "NewListUnspentCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "listunspent", "JSON", "-", "RPC", "command", ".", "The", "parameters", "which", "are", "pointers", "indicate", "they", "are", "optional", ".", "Passing",...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L426-L432
162,825
btcsuite/btcd
btcjson/walletsvrcmds.go
NewLockUnspentCmd
func NewLockUnspentCmd(unlock bool, transactions []TransactionInput) *LockUnspentCmd { return &LockUnspentCmd{ Unlock: unlock, Transactions: transactions, } }
go
func NewLockUnspentCmd(unlock bool, transactions []TransactionInput) *LockUnspentCmd { return &LockUnspentCmd{ Unlock: unlock, Transactions: transactions, } }
[ "func", "NewLockUnspentCmd", "(", "unlock", "bool", ",", "transactions", "[", "]", "TransactionInput", ")", "*", "LockUnspentCmd", "{", "return", "&", "LockUnspentCmd", "{", "Unlock", ":", "unlock", ",", "Transactions", ":", "transactions", ",", "}", "\n", "}"...
// NewLockUnspentCmd returns a new instance which can be used to issue a // lockunspent JSON-RPC command.
[ "NewLockUnspentCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "lockunspent", "JSON", "-", "RPC", "command", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L442-L447
162,826
btcsuite/btcd
btcjson/walletsvrcmds.go
NewMoveCmd
func NewMoveCmd(fromAccount, toAccount string, amount float64, minConf *int, comment *string) *MoveCmd { return &MoveCmd{ FromAccount: fromAccount, ToAccount: toAccount, Amount: amount, MinConf: minConf, Comment: comment, } }
go
func NewMoveCmd(fromAccount, toAccount string, amount float64, minConf *int, comment *string) *MoveCmd { return &MoveCmd{ FromAccount: fromAccount, ToAccount: toAccount, Amount: amount, MinConf: minConf, Comment: comment, } }
[ "func", "NewMoveCmd", "(", "fromAccount", ",", "toAccount", "string", ",", "amount", "float64", ",", "minConf", "*", "int", ",", "comment", "*", "string", ")", "*", "MoveCmd", "{", "return", "&", "MoveCmd", "{", "FromAccount", ":", "fromAccount", ",", "ToA...
// NewMoveCmd returns a new instance which can be used to issue a move JSON-RPC // command. // // The parameters which are pointers indicate they are optional. Passing nil // for optional parameters will use the default value.
[ "NewMoveCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "move", "JSON", "-", "RPC", "command", ".", "The", "parameters", "which", "are", "pointers", "indicate", "they", "are", "optional", ".", "Passing", "nil", "f...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L463-L471
162,827
btcsuite/btcd
btcjson/walletsvrcmds.go
NewSendFromCmd
func NewSendFromCmd(fromAccount, toAddress string, amount float64, minConf *int, comment, commentTo *string) *SendFromCmd { return &SendFromCmd{ FromAccount: fromAccount, ToAddress: toAddress, Amount: amount, MinConf: minConf, Comment: comment, CommentTo: commentTo, } }
go
func NewSendFromCmd(fromAccount, toAddress string, amount float64, minConf *int, comment, commentTo *string) *SendFromCmd { return &SendFromCmd{ FromAccount: fromAccount, ToAddress: toAddress, Amount: amount, MinConf: minConf, Comment: comment, CommentTo: commentTo, } }
[ "func", "NewSendFromCmd", "(", "fromAccount", ",", "toAddress", "string", ",", "amount", "float64", ",", "minConf", "*", "int", ",", "comment", ",", "commentTo", "*", "string", ")", "*", "SendFromCmd", "{", "return", "&", "SendFromCmd", "{", "FromAccount", "...
// NewSendFromCmd returns a new instance which can be used to issue a sendfrom // JSON-RPC command. // // The parameters which are pointers indicate they are optional. Passing nil // for optional parameters will use the default value.
[ "NewSendFromCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "sendfrom", "JSON", "-", "RPC", "command", ".", "The", "parameters", "which", "are", "pointers", "indicate", "they", "are", "optional", ".", "Passing", "ni...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L488-L497
162,828
btcsuite/btcd
btcjson/walletsvrcmds.go
NewSendManyCmd
func NewSendManyCmd(fromAccount string, amounts map[string]float64, minConf *int, comment *string) *SendManyCmd { return &SendManyCmd{ FromAccount: fromAccount, Amounts: amounts, MinConf: minConf, Comment: comment, } }
go
func NewSendManyCmd(fromAccount string, amounts map[string]float64, minConf *int, comment *string) *SendManyCmd { return &SendManyCmd{ FromAccount: fromAccount, Amounts: amounts, MinConf: minConf, Comment: comment, } }
[ "func", "NewSendManyCmd", "(", "fromAccount", "string", ",", "amounts", "map", "[", "string", "]", "float64", ",", "minConf", "*", "int", ",", "comment", "*", "string", ")", "*", "SendManyCmd", "{", "return", "&", "SendManyCmd", "{", "FromAccount", ":", "f...
// NewSendManyCmd returns a new instance which can be used to issue a sendmany // JSON-RPC command. // // The parameters which are pointers indicate they are optional. Passing nil // for optional parameters will use the default value.
[ "NewSendManyCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "sendmany", "JSON", "-", "RPC", "command", ".", "The", "parameters", "which", "are", "pointers", "indicate", "they", "are", "optional", ".", "Passing", "ni...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L512-L519
162,829
btcsuite/btcd
btcjson/walletsvrcmds.go
NewSendToAddressCmd
func NewSendToAddressCmd(address string, amount float64, comment, commentTo *string) *SendToAddressCmd { return &SendToAddressCmd{ Address: address, Amount: amount, Comment: comment, CommentTo: commentTo, } }
go
func NewSendToAddressCmd(address string, amount float64, comment, commentTo *string) *SendToAddressCmd { return &SendToAddressCmd{ Address: address, Amount: amount, Comment: comment, CommentTo: commentTo, } }
[ "func", "NewSendToAddressCmd", "(", "address", "string", ",", "amount", "float64", ",", "comment", ",", "commentTo", "*", "string", ")", "*", "SendToAddressCmd", "{", "return", "&", "SendToAddressCmd", "{", "Address", ":", "address", ",", "Amount", ":", "amoun...
// NewSendToAddressCmd returns a new instance which can be used to issue a // sendtoaddress JSON-RPC command. // // The parameters which are pointers indicate they are optional. Passing nil // for optional parameters will use the default value.
[ "NewSendToAddressCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "sendtoaddress", "JSON", "-", "RPC", "command", ".", "The", "parameters", "which", "are", "pointers", "indicate", "they", "are", "optional", ".", "Passi...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L534-L541
162,830
btcsuite/btcd
btcjson/walletsvrcmds.go
NewSetAccountCmd
func NewSetAccountCmd(address, account string) *SetAccountCmd { return &SetAccountCmd{ Address: address, Account: account, } }
go
func NewSetAccountCmd(address, account string) *SetAccountCmd { return &SetAccountCmd{ Address: address, Account: account, } }
[ "func", "NewSetAccountCmd", "(", "address", ",", "account", "string", ")", "*", "SetAccountCmd", "{", "return", "&", "SetAccountCmd", "{", "Address", ":", "address", ",", "Account", ":", "account", ",", "}", "\n", "}" ]
// NewSetAccountCmd returns a new instance which can be used to issue a // setaccount JSON-RPC command.
[ "NewSetAccountCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "setaccount", "JSON", "-", "RPC", "command", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L551-L556
162,831
btcsuite/btcd
btcjson/walletsvrcmds.go
NewSignMessageCmd
func NewSignMessageCmd(address, message string) *SignMessageCmd { return &SignMessageCmd{ Address: address, Message: message, } }
go
func NewSignMessageCmd(address, message string) *SignMessageCmd { return &SignMessageCmd{ Address: address, Message: message, } }
[ "func", "NewSignMessageCmd", "(", "address", ",", "message", "string", ")", "*", "SignMessageCmd", "{", "return", "&", "SignMessageCmd", "{", "Address", ":", "address", ",", "Message", ":", "message", ",", "}", "\n", "}" ]
// NewSignMessageCmd returns a new instance which can be used to issue a // signmessage JSON-RPC command.
[ "NewSignMessageCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "signmessage", "JSON", "-", "RPC", "command", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L579-L584
162,832
btcsuite/btcd
btcjson/walletsvrcmds.go
NewSignRawTransactionCmd
func NewSignRawTransactionCmd(hexEncodedTx string, inputs *[]RawTxInput, privKeys *[]string, flags *string) *SignRawTransactionCmd { return &SignRawTransactionCmd{ RawTx: hexEncodedTx, Inputs: inputs, PrivKeys: privKeys, Flags: flags, } }
go
func NewSignRawTransactionCmd(hexEncodedTx string, inputs *[]RawTxInput, privKeys *[]string, flags *string) *SignRawTransactionCmd { return &SignRawTransactionCmd{ RawTx: hexEncodedTx, Inputs: inputs, PrivKeys: privKeys, Flags: flags, } }
[ "func", "NewSignRawTransactionCmd", "(", "hexEncodedTx", "string", ",", "inputs", "*", "[", "]", "RawTxInput", ",", "privKeys", "*", "[", "]", "string", ",", "flags", "*", "string", ")", "*", "SignRawTransactionCmd", "{", "return", "&", "SignRawTransactionCmd", ...
// NewSignRawTransactionCmd returns a new instance which can be used to issue a // signrawtransaction JSON-RPC command. // // The parameters which are pointers indicate they are optional. Passing nil // for optional parameters will use the default value.
[ "NewSignRawTransactionCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "signrawtransaction", "JSON", "-", "RPC", "command", ".", "The", "parameters", "which", "are", "pointers", "indicate", "they", "are", "optional", "."...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L608-L615
162,833
btcsuite/btcd
btcjson/walletsvrcmds.go
NewWalletPassphraseCmd
func NewWalletPassphraseCmd(passphrase string, timeout int64) *WalletPassphraseCmd { return &WalletPassphraseCmd{ Passphrase: passphrase, Timeout: timeout, } }
go
func NewWalletPassphraseCmd(passphrase string, timeout int64) *WalletPassphraseCmd { return &WalletPassphraseCmd{ Passphrase: passphrase, Timeout: timeout, } }
[ "func", "NewWalletPassphraseCmd", "(", "passphrase", "string", ",", "timeout", "int64", ")", "*", "WalletPassphraseCmd", "{", "return", "&", "WalletPassphraseCmd", "{", "Passphrase", ":", "passphrase", ",", "Timeout", ":", "timeout", ",", "}", "\n", "}" ]
// NewWalletPassphraseCmd returns a new instance which can be used to issue a // walletpassphrase JSON-RPC command.
[ "NewWalletPassphraseCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "walletpassphrase", "JSON", "-", "RPC", "command", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L634-L639
162,834
btcsuite/btcd
btcjson/walletsvrcmds.go
NewWalletPassphraseChangeCmd
func NewWalletPassphraseChangeCmd(oldPassphrase, newPassphrase string) *WalletPassphraseChangeCmd { return &WalletPassphraseChangeCmd{ OldPassphrase: oldPassphrase, NewPassphrase: newPassphrase, } }
go
func NewWalletPassphraseChangeCmd(oldPassphrase, newPassphrase string) *WalletPassphraseChangeCmd { return &WalletPassphraseChangeCmd{ OldPassphrase: oldPassphrase, NewPassphrase: newPassphrase, } }
[ "func", "NewWalletPassphraseChangeCmd", "(", "oldPassphrase", ",", "newPassphrase", "string", ")", "*", "WalletPassphraseChangeCmd", "{", "return", "&", "WalletPassphraseChangeCmd", "{", "OldPassphrase", ":", "oldPassphrase", ",", "NewPassphrase", ":", "newPassphrase", ",...
// NewWalletPassphraseChangeCmd returns a new instance which can be used to // issue a walletpassphrasechange JSON-RPC command.
[ "NewWalletPassphraseChangeCmd", "returns", "a", "new", "instance", "which", "can", "be", "used", "to", "issue", "a", "walletpassphrasechange", "JSON", "-", "RPC", "command", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/walletsvrcmds.go#L649-L654
162,835
btcsuite/btcd
blockchain/utxoviewpoint.go
Clone
func (entry *UtxoEntry) Clone() *UtxoEntry { if entry == nil { return nil } return &UtxoEntry{ amount: entry.amount, pkScript: entry.pkScript, blockHeight: entry.blockHeight, packedFlags: entry.packedFlags, } }
go
func (entry *UtxoEntry) Clone() *UtxoEntry { if entry == nil { return nil } return &UtxoEntry{ amount: entry.amount, pkScript: entry.pkScript, blockHeight: entry.blockHeight, packedFlags: entry.packedFlags, } }
[ "func", "(", "entry", "*", "UtxoEntry", ")", "Clone", "(", ")", "*", "UtxoEntry", "{", "if", "entry", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "return", "&", "UtxoEntry", "{", "amount", ":", "entry", ".", "amount", ",", "pkScript", ":", ...
// Clone returns a shallow copy of the utxo entry.
[ "Clone", "returns", "a", "shallow", "copy", "of", "the", "utxo", "entry", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/utxoviewpoint.go#L101-L112
162,836
btcsuite/btcd
blockchain/utxoviewpoint.go
LookupEntry
func (view *UtxoViewpoint) LookupEntry(outpoint wire.OutPoint) *UtxoEntry { return view.entries[outpoint] }
go
func (view *UtxoViewpoint) LookupEntry(outpoint wire.OutPoint) *UtxoEntry { return view.entries[outpoint] }
[ "func", "(", "view", "*", "UtxoViewpoint", ")", "LookupEntry", "(", "outpoint", "wire", ".", "OutPoint", ")", "*", "UtxoEntry", "{", "return", "view", ".", "entries", "[", "outpoint", "]", "\n", "}" ]
// LookupEntry returns information about a given transaction output according to // the current state of the view. It will return nil if the passed output does // not exist in the view or is otherwise not available such as when it has been // disconnected during a reorg.
[ "LookupEntry", "returns", "information", "about", "a", "given", "transaction", "output", "according", "to", "the", "current", "state", "of", "the", "view", ".", "It", "will", "return", "nil", "if", "the", "passed", "output", "does", "not", "exist", "in", "th...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/utxoviewpoint.go#L142-L144
162,837
btcsuite/btcd
blockchain/utxoviewpoint.go
addTxOut
func (view *UtxoViewpoint) addTxOut(outpoint wire.OutPoint, txOut *wire.TxOut, isCoinBase bool, blockHeight int32) { // Don't add provably unspendable outputs. if txscript.IsUnspendable(txOut.PkScript) { return } // Update existing entries. All fields are updated because it's // possible (although extremely un...
go
func (view *UtxoViewpoint) addTxOut(outpoint wire.OutPoint, txOut *wire.TxOut, isCoinBase bool, blockHeight int32) { // Don't add provably unspendable outputs. if txscript.IsUnspendable(txOut.PkScript) { return } // Update existing entries. All fields are updated because it's // possible (although extremely un...
[ "func", "(", "view", "*", "UtxoViewpoint", ")", "addTxOut", "(", "outpoint", "wire", ".", "OutPoint", ",", "txOut", "*", "wire", ".", "TxOut", ",", "isCoinBase", "bool", ",", "blockHeight", "int32", ")", "{", "// Don't add provably unspendable outputs.", "if", ...
// addTxOut adds the specified output to the view if it is not provably // unspendable. When the view already has an entry for the output, it will be // marked unspent. All fields will be updated for existing entries since it's // possible it has changed during a reorg.
[ "addTxOut", "adds", "the", "specified", "output", "to", "the", "view", "if", "it", "is", "not", "provably", "unspendable", ".", "When", "the", "view", "already", "has", "an", "entry", "for", "the", "output", "it", "will", "be", "marked", "unspent", ".", ...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/utxoviewpoint.go#L150-L173
162,838
btcsuite/btcd
blockchain/utxoviewpoint.go
AddTxOut
func (view *UtxoViewpoint) AddTxOut(tx *btcutil.Tx, txOutIdx uint32, blockHeight int32) { // Can't add an output for an out of bounds index. if txOutIdx >= uint32(len(tx.MsgTx().TxOut)) { return } // Update existing entries. All fields are updated because it's // possible (although extremely unlikely) that the...
go
func (view *UtxoViewpoint) AddTxOut(tx *btcutil.Tx, txOutIdx uint32, blockHeight int32) { // Can't add an output for an out of bounds index. if txOutIdx >= uint32(len(tx.MsgTx().TxOut)) { return } // Update existing entries. All fields are updated because it's // possible (although extremely unlikely) that the...
[ "func", "(", "view", "*", "UtxoViewpoint", ")", "AddTxOut", "(", "tx", "*", "btcutil", ".", "Tx", ",", "txOutIdx", "uint32", ",", "blockHeight", "int32", ")", "{", "// Can't add an output for an out of bounds index.", "if", "txOutIdx", ">=", "uint32", "(", "len"...
// AddTxOut adds the specified output of the passed transaction to the view if // it exists and is not provably unspendable. When the view already has an // entry for the output, it will be marked unspent. All fields will be updated // for existing entries since it's possible it has changed during a reorg.
[ "AddTxOut", "adds", "the", "specified", "output", "of", "the", "passed", "transaction", "to", "the", "view", "if", "it", "exists", "and", "is", "not", "provably", "unspendable", ".", "When", "the", "view", "already", "has", "an", "entry", "for", "the", "ou...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/utxoviewpoint.go#L179-L192
162,839
btcsuite/btcd
blockchain/utxoviewpoint.go
connectTransaction
func (view *UtxoViewpoint) connectTransaction(tx *btcutil.Tx, blockHeight int32, stxos *[]SpentTxOut) error { // Coinbase transactions don't have any inputs to spend. if IsCoinBase(tx) { // Add the transaction's outputs as available utxos. view.AddTxOuts(tx, blockHeight) return nil } // Spend the referenced ...
go
func (view *UtxoViewpoint) connectTransaction(tx *btcutil.Tx, blockHeight int32, stxos *[]SpentTxOut) error { // Coinbase transactions don't have any inputs to spend. if IsCoinBase(tx) { // Add the transaction's outputs as available utxos. view.AddTxOuts(tx, blockHeight) return nil } // Spend the referenced ...
[ "func", "(", "view", "*", "UtxoViewpoint", ")", "connectTransaction", "(", "tx", "*", "btcutil", ".", "Tx", ",", "blockHeight", "int32", ",", "stxos", "*", "[", "]", "SpentTxOut", ")", "error", "{", "// Coinbase transactions don't have any inputs to spend.", "if",...
// connectTransaction updates the view by adding all new utxos created by the // passed transaction and marking all utxos that the transactions spend as // spent. In addition, when the 'stxos' argument is not nil, it will be updated // to append an entry for each spent txout. An error will be returned if the // view ...
[ "connectTransaction", "updates", "the", "view", "by", "adding", "all", "new", "utxos", "created", "by", "the", "passed", "transaction", "and", "marking", "all", "utxos", "that", "the", "transactions", "spend", "as", "spent", ".", "In", "addition", "when", "the...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/utxoviewpoint.go#L219-L260
162,840
btcsuite/btcd
blockchain/utxoviewpoint.go
connectTransactions
func (view *UtxoViewpoint) connectTransactions(block *btcutil.Block, stxos *[]SpentTxOut) error { for _, tx := range block.Transactions() { err := view.connectTransaction(tx, block.Height(), stxos) if err != nil { return err } } // Update the best hash for view to include this block since all of its // tr...
go
func (view *UtxoViewpoint) connectTransactions(block *btcutil.Block, stxos *[]SpentTxOut) error { for _, tx := range block.Transactions() { err := view.connectTransaction(tx, block.Height(), stxos) if err != nil { return err } } // Update the best hash for view to include this block since all of its // tr...
[ "func", "(", "view", "*", "UtxoViewpoint", ")", "connectTransactions", "(", "block", "*", "btcutil", ".", "Block", ",", "stxos", "*", "[", "]", "SpentTxOut", ")", "error", "{", "for", "_", ",", "tx", ":=", "range", "block", ".", "Transactions", "(", ")...
// connectTransactions updates the view by adding all new utxos created by all // of the transactions in the passed block, marking all utxos the transactions // spend as spent, and setting the best hash for the view to the passed block. // In addition, when the 'stxos' argument is not nil, it will be updated to // appe...
[ "connectTransactions", "updates", "the", "view", "by", "adding", "all", "new", "utxos", "created", "by", "all", "of", "the", "transactions", "in", "the", "passed", "block", "marking", "all", "utxos", "the", "transactions", "spend", "as", "spent", "and", "setti...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/utxoviewpoint.go#L267-L279
162,841
btcsuite/btcd
blockchain/utxoviewpoint.go
fetchEntryByHash
func (view *UtxoViewpoint) fetchEntryByHash(db database.DB, hash *chainhash.Hash) (*UtxoEntry, error) { // First attempt to find a utxo with the provided hash in the view. prevOut := wire.OutPoint{Hash: *hash} for idx := uint32(0); idx < MaxOutputsPerBlock; idx++ { prevOut.Index = idx entry := view.LookupEntry(p...
go
func (view *UtxoViewpoint) fetchEntryByHash(db database.DB, hash *chainhash.Hash) (*UtxoEntry, error) { // First attempt to find a utxo with the provided hash in the view. prevOut := wire.OutPoint{Hash: *hash} for idx := uint32(0); idx < MaxOutputsPerBlock; idx++ { prevOut.Index = idx entry := view.LookupEntry(p...
[ "func", "(", "view", "*", "UtxoViewpoint", ")", "fetchEntryByHash", "(", "db", "database", ".", "DB", ",", "hash", "*", "chainhash", ".", "Hash", ")", "(", "*", "UtxoEntry", ",", "error", ")", "{", "// First attempt to find a utxo with the provided hash in the vie...
// fetchEntryByHash attempts to find any available utxo for the given hash by // searching the entire set of possible outputs for the given hash. It checks // the view first and then falls back to the database if needed.
[ "fetchEntryByHash", "attempts", "to", "find", "any", "available", "utxo", "for", "the", "given", "hash", "by", "searching", "the", "entire", "set", "of", "possible", "outputs", "for", "the", "given", "hash", ".", "It", "checks", "the", "view", "first", "and"...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/utxoviewpoint.go#L284-L305
162,842
btcsuite/btcd
blockchain/utxoviewpoint.go
disconnectTransactions
func (view *UtxoViewpoint) disconnectTransactions(db database.DB, block *btcutil.Block, stxos []SpentTxOut) error { // Sanity check the correct number of stxos are provided. if len(stxos) != countSpentOutputs(block) { return AssertError("disconnectTransactions called with bad " + "spent transaction out informati...
go
func (view *UtxoViewpoint) disconnectTransactions(db database.DB, block *btcutil.Block, stxos []SpentTxOut) error { // Sanity check the correct number of stxos are provided. if len(stxos) != countSpentOutputs(block) { return AssertError("disconnectTransactions called with bad " + "spent transaction out informati...
[ "func", "(", "view", "*", "UtxoViewpoint", ")", "disconnectTransactions", "(", "db", "database", ".", "DB", ",", "block", "*", "btcutil", ".", "Block", ",", "stxos", "[", "]", "SpentTxOut", ")", "error", "{", "// Sanity check the correct number of stxos are provid...
// disconnectTransactions updates the view by removing all of the transactions // created by the passed block, restoring all utxos the transactions spent by // using the provided spent txo information, and setting the best hash for the // view to the block before the passed block.
[ "disconnectTransactions", "updates", "the", "view", "by", "removing", "all", "of", "the", "transactions", "created", "by", "the", "passed", "block", "restoring", "all", "utxos", "the", "transactions", "spent", "by", "using", "the", "provided", "spent", "txo", "i...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/utxoviewpoint.go#L311-L439
162,843
btcsuite/btcd
blockchain/utxoviewpoint.go
RemoveEntry
func (view *UtxoViewpoint) RemoveEntry(outpoint wire.OutPoint) { delete(view.entries, outpoint) }
go
func (view *UtxoViewpoint) RemoveEntry(outpoint wire.OutPoint) { delete(view.entries, outpoint) }
[ "func", "(", "view", "*", "UtxoViewpoint", ")", "RemoveEntry", "(", "outpoint", "wire", ".", "OutPoint", ")", "{", "delete", "(", "view", ".", "entries", ",", "outpoint", ")", "\n", "}" ]
// RemoveEntry removes the given transaction output from the current state of // the view. It will have no effect if the passed output does not exist in the // view.
[ "RemoveEntry", "removes", "the", "given", "transaction", "output", "from", "the", "current", "state", "of", "the", "view", ".", "It", "will", "have", "no", "effect", "if", "the", "passed", "output", "does", "not", "exist", "in", "the", "view", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/utxoviewpoint.go#L444-L446
162,844
btcsuite/btcd
blockchain/utxoviewpoint.go
commit
func (view *UtxoViewpoint) commit() { for outpoint, entry := range view.entries { if entry == nil || (entry.isModified() && entry.IsSpent()) { delete(view.entries, outpoint) continue } entry.packedFlags ^= tfModified } }
go
func (view *UtxoViewpoint) commit() { for outpoint, entry := range view.entries { if entry == nil || (entry.isModified() && entry.IsSpent()) { delete(view.entries, outpoint) continue } entry.packedFlags ^= tfModified } }
[ "func", "(", "view", "*", "UtxoViewpoint", ")", "commit", "(", ")", "{", "for", "outpoint", ",", "entry", ":=", "range", "view", ".", "entries", "{", "if", "entry", "==", "nil", "||", "(", "entry", ".", "isModified", "(", ")", "&&", "entry", ".", "...
// commit prunes all entries marked modified that are now fully spent and marks // all entries as unmodified.
[ "commit", "prunes", "all", "entries", "marked", "modified", "that", "are", "now", "fully", "spent", "and", "marks", "all", "entries", "as", "unmodified", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/utxoviewpoint.go#L455-L464
162,845
btcsuite/btcd
blockchain/utxoviewpoint.go
fetchUtxosMain
func (view *UtxoViewpoint) fetchUtxosMain(db database.DB, outpoints map[wire.OutPoint]struct{}) error { // Nothing to do if there are no requested outputs. if len(outpoints) == 0 { return nil } // Load the requested set of unspent transaction outputs from the point // of view of the end of the main chain. // ...
go
func (view *UtxoViewpoint) fetchUtxosMain(db database.DB, outpoints map[wire.OutPoint]struct{}) error { // Nothing to do if there are no requested outputs. if len(outpoints) == 0 { return nil } // Load the requested set of unspent transaction outputs from the point // of view of the end of the main chain. // ...
[ "func", "(", "view", "*", "UtxoViewpoint", ")", "fetchUtxosMain", "(", "db", "database", ".", "DB", ",", "outpoints", "map", "[", "wire", ".", "OutPoint", "]", "struct", "{", "}", ")", "error", "{", "// Nothing to do if there are no requested outputs.", "if", ...
// fetchUtxosMain fetches unspent transaction output data about the provided // set of outpoints from the point of view of the end of the main chain at the // time of the call. // // Upon completion of this function, the view will contain an entry for each // requested outpoint. Spent outputs, or those which otherwise...
[ "fetchUtxosMain", "fetches", "unspent", "transaction", "output", "data", "about", "the", "provided", "set", "of", "outpoints", "from", "the", "point", "of", "view", "of", "the", "end", "of", "the", "main", "chain", "at", "the", "time", "of", "the", "call", ...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/utxoviewpoint.go#L473-L498
162,846
btcsuite/btcd
blockchain/utxoviewpoint.go
fetchUtxos
func (view *UtxoViewpoint) fetchUtxos(db database.DB, outpoints map[wire.OutPoint]struct{}) error { // Nothing to do if there are no requested outputs. if len(outpoints) == 0 { return nil } // Filter entries that are already in the view. neededSet := make(map[wire.OutPoint]struct{}) for outpoint := range outpo...
go
func (view *UtxoViewpoint) fetchUtxos(db database.DB, outpoints map[wire.OutPoint]struct{}) error { // Nothing to do if there are no requested outputs. if len(outpoints) == 0 { return nil } // Filter entries that are already in the view. neededSet := make(map[wire.OutPoint]struct{}) for outpoint := range outpo...
[ "func", "(", "view", "*", "UtxoViewpoint", ")", "fetchUtxos", "(", "db", "database", ".", "DB", ",", "outpoints", "map", "[", "wire", ".", "OutPoint", "]", "struct", "{", "}", ")", "error", "{", "// Nothing to do if there are no requested outputs.", "if", "len...
// fetchUtxos loads the unspent transaction outputs for the provided set of // outputs into the view from the database as needed unless they already exist // in the view in which case they are ignored.
[ "fetchUtxos", "loads", "the", "unspent", "transaction", "outputs", "for", "the", "provided", "set", "of", "outputs", "into", "the", "view", "from", "the", "database", "as", "needed", "unless", "they", "already", "exist", "in", "the", "view", "in", "which", "...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/utxoviewpoint.go#L503-L522
162,847
btcsuite/btcd
blockchain/utxoviewpoint.go
fetchInputUtxos
func (view *UtxoViewpoint) fetchInputUtxos(db database.DB, block *btcutil.Block) error { // Build a map of in-flight transactions because some of the inputs in // this block could be referencing other transactions earlier in this // block which are not yet in the chain. txInFlight := map[chainhash.Hash]int{} trans...
go
func (view *UtxoViewpoint) fetchInputUtxos(db database.DB, block *btcutil.Block) error { // Build a map of in-flight transactions because some of the inputs in // this block could be referencing other transactions earlier in this // block which are not yet in the chain. txInFlight := map[chainhash.Hash]int{} trans...
[ "func", "(", "view", "*", "UtxoViewpoint", ")", "fetchInputUtxos", "(", "db", "database", ".", "DB", ",", "block", "*", "btcutil", ".", "Block", ")", "error", "{", "// Build a map of in-flight transactions because some of the inputs in", "// this block could be referencin...
// fetchInputUtxos loads the unspent transaction outputs for the inputs // referenced by the transactions in the given block into the view from the // database as needed. In particular, referenced entries that are earlier in // the block are added to the view and entries that are already in the view are // not modifie...
[ "fetchInputUtxos", "loads", "the", "unspent", "transaction", "outputs", "for", "the", "inputs", "referenced", "by", "the", "transactions", "in", "the", "given", "block", "into", "the", "view", "from", "the", "database", "as", "needed", ".", "In", "particular", ...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/utxoviewpoint.go#L529-L577
162,848
btcsuite/btcd
blockchain/utxoviewpoint.go
FetchUtxoView
func (b *BlockChain) FetchUtxoView(tx *btcutil.Tx) (*UtxoViewpoint, error) { // Create a set of needed outputs based on those referenced by the // inputs of the passed transaction and the outputs of the transaction // itself. neededSet := make(map[wire.OutPoint]struct{}) prevOut := wire.OutPoint{Hash: *tx.Hash()} ...
go
func (b *BlockChain) FetchUtxoView(tx *btcutil.Tx) (*UtxoViewpoint, error) { // Create a set of needed outputs based on those referenced by the // inputs of the passed transaction and the outputs of the transaction // itself. neededSet := make(map[wire.OutPoint]struct{}) prevOut := wire.OutPoint{Hash: *tx.Hash()} ...
[ "func", "(", "b", "*", "BlockChain", ")", "FetchUtxoView", "(", "tx", "*", "btcutil", ".", "Tx", ")", "(", "*", "UtxoViewpoint", ",", "error", ")", "{", "// Create a set of needed outputs based on those referenced by the", "// inputs of the passed transaction and the outp...
// FetchUtxoView loads unspent transaction outputs for the inputs referenced by // the passed transaction from the point of view of the end of the main chain. // It also attempts to fetch the utxos for the outputs of the transaction itself // so the returned view can be examined for duplicate transactions. // // This f...
[ "FetchUtxoView", "loads", "unspent", "transaction", "outputs", "for", "the", "inputs", "referenced", "by", "the", "passed", "transaction", "from", "the", "point", "of", "view", "of", "the", "end", "of", "the", "main", "chain", ".", "It", "also", "attempts", ...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/utxoviewpoint.go#L592-L615
162,849
btcsuite/btcd
wire/msgalert.go
Serialize
func (alert *Alert) Serialize(w io.Writer, pver uint32) error { err := writeElements(w, alert.Version, alert.RelayUntil, alert.Expiration, alert.ID, alert.Cancel) if err != nil { return err } count := len(alert.SetCancel) if count > maxCountSetCancel { str := fmt.Sprintf("too many cancel alert IDs for alert...
go
func (alert *Alert) Serialize(w io.Writer, pver uint32) error { err := writeElements(w, alert.Version, alert.RelayUntil, alert.Expiration, alert.ID, alert.Cancel) if err != nil { return err } count := len(alert.SetCancel) if count > maxCountSetCancel { str := fmt.Sprintf("too many cancel alert IDs for alert...
[ "func", "(", "alert", "*", "Alert", ")", "Serialize", "(", "w", "io", ".", "Writer", ",", "pver", "uint32", ")", "error", "{", "err", ":=", "writeElements", "(", "w", ",", "alert", ".", "Version", ",", "alert", ".", "RelayUntil", ",", "alert", ".", ...
// Serialize encodes the alert to w using the alert protocol encoding format.
[ "Serialize", "encodes", "the", "alert", "to", "w", "using", "the", "alert", "protocol", "encoding", "format", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/wire/msgalert.go#L151-L210
162,850
btcsuite/btcd
wire/msgalert.go
Deserialize
func (alert *Alert) Deserialize(r io.Reader, pver uint32) error { err := readElements(r, &alert.Version, &alert.RelayUntil, &alert.Expiration, &alert.ID, &alert.Cancel) if err != nil { return err } // SetCancel: first read a VarInt that contains // count - the number of Cancel IDs, then // iterate count time...
go
func (alert *Alert) Deserialize(r io.Reader, pver uint32) error { err := readElements(r, &alert.Version, &alert.RelayUntil, &alert.Expiration, &alert.ID, &alert.Cancel) if err != nil { return err } // SetCancel: first read a VarInt that contains // count - the number of Cancel IDs, then // iterate count time...
[ "func", "(", "alert", "*", "Alert", ")", "Deserialize", "(", "r", "io", ".", "Reader", ",", "pver", "uint32", ")", "error", "{", "err", ":=", "readElements", "(", "r", ",", "&", "alert", ".", "Version", ",", "&", "alert", ".", "RelayUntil", ",", "&...
// Deserialize decodes from r into the receiver using the alert protocol // encoding format.
[ "Deserialize", "decodes", "from", "r", "into", "the", "receiver", "using", "the", "alert", "protocol", "encoding", "format", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/wire/msgalert.go#L214-L279
162,851
btcsuite/btcd
wire/msgalert.go
NewAlert
func NewAlert(version int32, relayUntil int64, expiration int64, id int32, cancel int32, setCancel []int32, minVer int32, maxVer int32, setSubVer []string, priority int32, comment string, statusBar string) *Alert { return &Alert{ Version: version, RelayUntil: relayUntil, Expiration: expiration, ID: ...
go
func NewAlert(version int32, relayUntil int64, expiration int64, id int32, cancel int32, setCancel []int32, minVer int32, maxVer int32, setSubVer []string, priority int32, comment string, statusBar string) *Alert { return &Alert{ Version: version, RelayUntil: relayUntil, Expiration: expiration, ID: ...
[ "func", "NewAlert", "(", "version", "int32", ",", "relayUntil", "int64", ",", "expiration", "int64", ",", "id", "int32", ",", "cancel", "int32", ",", "setCancel", "[", "]", "int32", ",", "minVer", "int32", ",", "maxVer", "int32", ",", "setSubVer", "[", "...
// NewAlert returns an new Alert with values provided.
[ "NewAlert", "returns", "an", "new", "Alert", "with", "values", "provided", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/wire/msgalert.go#L282-L301
162,852
btcsuite/btcd
wire/msgalert.go
NewAlertFromPayload
func NewAlertFromPayload(serializedPayload []byte, pver uint32) (*Alert, error) { var alert Alert r := bytes.NewReader(serializedPayload) err := alert.Deserialize(r, pver) if err != nil { return nil, err } return &alert, nil }
go
func NewAlertFromPayload(serializedPayload []byte, pver uint32) (*Alert, error) { var alert Alert r := bytes.NewReader(serializedPayload) err := alert.Deserialize(r, pver) if err != nil { return nil, err } return &alert, nil }
[ "func", "NewAlertFromPayload", "(", "serializedPayload", "[", "]", "byte", ",", "pver", "uint32", ")", "(", "*", "Alert", ",", "error", ")", "{", "var", "alert", "Alert", "\n", "r", ":=", "bytes", ".", "NewReader", "(", "serializedPayload", ")", "\n", "e...
// NewAlertFromPayload returns an Alert with values deserialized from the // serialized payload.
[ "NewAlertFromPayload", "returns", "an", "Alert", "with", "values", "deserialized", "from", "the", "serialized", "payload", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/wire/msgalert.go#L305-L313
162,853
btcsuite/btcd
wire/msgalert.go
NewMsgAlert
func NewMsgAlert(serializedPayload []byte, signature []byte) *MsgAlert { return &MsgAlert{ SerializedPayload: serializedPayload, Signature: signature, Payload: nil, } }
go
func NewMsgAlert(serializedPayload []byte, signature []byte) *MsgAlert { return &MsgAlert{ SerializedPayload: serializedPayload, Signature: signature, Payload: nil, } }
[ "func", "NewMsgAlert", "(", "serializedPayload", "[", "]", "byte", ",", "signature", "[", "]", "byte", ")", "*", "MsgAlert", "{", "return", "&", "MsgAlert", "{", "SerializedPayload", ":", "serializedPayload", ",", "Signature", ":", "signature", ",", "Payload",...
// NewMsgAlert returns a new bitcoin alert message that conforms to the Message // interface. See MsgAlert for details.
[ "NewMsgAlert", "returns", "a", "new", "bitcoin", "alert", "message", "that", "conforms", "to", "the", "Message", "interface", ".", "See", "MsgAlert", "for", "details", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/wire/msgalert.go#L401-L407
162,854
btcsuite/btcd
blockchain/weight.go
GetBlockWeight
func GetBlockWeight(blk *btcutil.Block) int64 { msgBlock := blk.MsgBlock() baseSize := msgBlock.SerializeSizeStripped() totalSize := msgBlock.SerializeSize() // (baseSize * 3) + totalSize return int64((baseSize * (WitnessScaleFactor - 1)) + totalSize) }
go
func GetBlockWeight(blk *btcutil.Block) int64 { msgBlock := blk.MsgBlock() baseSize := msgBlock.SerializeSizeStripped() totalSize := msgBlock.SerializeSize() // (baseSize * 3) + totalSize return int64((baseSize * (WitnessScaleFactor - 1)) + totalSize) }
[ "func", "GetBlockWeight", "(", "blk", "*", "btcutil", ".", "Block", ")", "int64", "{", "msgBlock", ":=", "blk", ".", "MsgBlock", "(", ")", "\n\n", "baseSize", ":=", "msgBlock", ".", "SerializeSizeStripped", "(", ")", "\n", "totalSize", ":=", "msgBlock", "....
// GetBlockWeight computes the value of the weight metric for a given block. // Currently the weight metric is simply the sum of the block's serialized size // without any witness data scaled proportionally by the WitnessScaleFactor, // and the block's serialized size including any witness data.
[ "GetBlockWeight", "computes", "the", "value", "of", "the", "weight", "metric", "for", "a", "given", "block", ".", "Currently", "the", "weight", "metric", "is", "simply", "the", "sum", "of", "the", "block", "s", "serialized", "size", "without", "any", "witnes...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/weight.go#L52-L60
162,855
btcsuite/btcd
blockchain/weight.go
GetTransactionWeight
func GetTransactionWeight(tx *btcutil.Tx) int64 { msgTx := tx.MsgTx() baseSize := msgTx.SerializeSizeStripped() totalSize := msgTx.SerializeSize() // (baseSize * 3) + totalSize return int64((baseSize * (WitnessScaleFactor - 1)) + totalSize) }
go
func GetTransactionWeight(tx *btcutil.Tx) int64 { msgTx := tx.MsgTx() baseSize := msgTx.SerializeSizeStripped() totalSize := msgTx.SerializeSize() // (baseSize * 3) + totalSize return int64((baseSize * (WitnessScaleFactor - 1)) + totalSize) }
[ "func", "GetTransactionWeight", "(", "tx", "*", "btcutil", ".", "Tx", ")", "int64", "{", "msgTx", ":=", "tx", ".", "MsgTx", "(", ")", "\n\n", "baseSize", ":=", "msgTx", ".", "SerializeSizeStripped", "(", ")", "\n", "totalSize", ":=", "msgTx", ".", "Seria...
// GetTransactionWeight computes the value of the weight metric for a given // transaction. Currently the weight metric is simply the sum of the // transactions's serialized size without any witness data scaled // proportionally by the WitnessScaleFactor, and the transaction's serialized // size including any witness d...
[ "GetTransactionWeight", "computes", "the", "value", "of", "the", "weight", "metric", "for", "a", "given", "transaction", ".", "Currently", "the", "weight", "metric", "is", "simply", "the", "sum", "of", "the", "transactions", "s", "serialized", "size", "without",...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/weight.go#L67-L75
162,856
btcsuite/btcd
cmd/btcctl/config.go
listCommands
func listCommands() { const ( categoryChain uint8 = iota categoryWallet numCategories ) // Get a list of registered commands and categorize and filter them. cmdMethods := btcjson.RegisteredCmdMethods() categorized := make([][]string, numCategories) for _, method := range cmdMethods { flags, err := btcjso...
go
func listCommands() { const ( categoryChain uint8 = iota categoryWallet numCategories ) // Get a list of registered commands and categorize and filter them. cmdMethods := btcjson.RegisteredCmdMethods() categorized := make([][]string, numCategories) for _, method := range cmdMethods { flags, err := btcjso...
[ "func", "listCommands", "(", ")", "{", "const", "(", "categoryChain", "uint8", "=", "iota", "\n", "categoryWallet", "\n", "numCategories", "\n", ")", "\n\n", "// Get a list of registered commands and categorize and filter them.", "cmdMethods", ":=", "btcjson", ".", "Reg...
// listCommands categorizes and lists all of the usable commands along with // their one-line usage.
[ "listCommands", "categorizes", "and", "lists", "all", "of", "the", "usable", "commands", "along", "with", "their", "one", "-", "line", "usage", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/cmd/btcctl/config.go#L40-L89
162,857
btcsuite/btcd
limits/limits_unix.go
SetLimits
func SetLimits() error { var rLimit syscall.Rlimit err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit) if err != nil { return err } if rLimit.Cur > fileLimitWant { return nil } if rLimit.Max < fileLimitMin { err = fmt.Errorf("need at least %v file descriptors", fileLimitMin) return err } if rL...
go
func SetLimits() error { var rLimit syscall.Rlimit err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit) if err != nil { return err } if rLimit.Cur > fileLimitWant { return nil } if rLimit.Max < fileLimitMin { err = fmt.Errorf("need at least %v file descriptors", fileLimitMin) return err } if rL...
[ "func", "SetLimits", "(", ")", "error", "{", "var", "rLimit", "syscall", ".", "Rlimit", "\n\n", "err", ":=", "syscall", ".", "Getrlimit", "(", "syscall", ".", "RLIMIT_NOFILE", ",", "&", "rLimit", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err...
// SetLimits raises some process limits to values which allow btcd and // associated utilities to run.
[ "SetLimits", "raises", "some", "process", "limits", "to", "values", "which", "allow", "btcd", "and", "associated", "utilities", "to", "run", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/limits/limits_unix.go#L21-L52
162,858
btcsuite/btcd
blockchain/thresholdstate.go
String
func (t ThresholdState) String() string { if s := thresholdStateStrings[t]; s != "" { return s } return fmt.Sprintf("Unknown ThresholdState (%d)", int(t)) }
go
func (t ThresholdState) String() string { if s := thresholdStateStrings[t]; s != "" { return s } return fmt.Sprintf("Unknown ThresholdState (%d)", int(t)) }
[ "func", "(", "t", "ThresholdState", ")", "String", "(", ")", "string", "{", "if", "s", ":=", "thresholdStateStrings", "[", "t", "]", ";", "s", "!=", "\"", "\"", "{", "return", "s", "\n", "}", "\n", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ...
// String returns the ThresholdState as a human-readable name.
[ "String", "returns", "the", "ThresholdState", "as", "a", "human", "-", "readable", "name", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/thresholdstate.go#L59-L64
162,859
btcsuite/btcd
blockchain/thresholdstate.go
Lookup
func (c *thresholdStateCache) Lookup(hash *chainhash.Hash) (ThresholdState, bool) { state, ok := c.entries[*hash] return state, ok }
go
func (c *thresholdStateCache) Lookup(hash *chainhash.Hash) (ThresholdState, bool) { state, ok := c.entries[*hash] return state, ok }
[ "func", "(", "c", "*", "thresholdStateCache", ")", "Lookup", "(", "hash", "*", "chainhash", ".", "Hash", ")", "(", "ThresholdState", ",", "bool", ")", "{", "state", ",", "ok", ":=", "c", ".", "entries", "[", "*", "hash", "]", "\n", "return", "state",...
// Lookup returns the threshold state associated with the given hash along with // a boolean that indicates whether or not it is valid.
[ "Lookup", "returns", "the", "threshold", "state", "associated", "with", "the", "given", "hash", "along", "with", "a", "boolean", "that", "indicates", "whether", "or", "not", "it", "is", "valid", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/thresholdstate.go#L101-L104
162,860
btcsuite/btcd
blockchain/thresholdstate.go
Update
func (c *thresholdStateCache) Update(hash *chainhash.Hash, state ThresholdState) { c.entries[*hash] = state }
go
func (c *thresholdStateCache) Update(hash *chainhash.Hash, state ThresholdState) { c.entries[*hash] = state }
[ "func", "(", "c", "*", "thresholdStateCache", ")", "Update", "(", "hash", "*", "chainhash", ".", "Hash", ",", "state", "ThresholdState", ")", "{", "c", ".", "entries", "[", "*", "hash", "]", "=", "state", "\n", "}" ]
// Update updates the cache to contain the provided hash to threshold state // mapping.
[ "Update", "updates", "the", "cache", "to", "contain", "the", "provided", "hash", "to", "threshold", "state", "mapping", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/thresholdstate.go#L108-L110
162,861
btcsuite/btcd
blockchain/thresholdstate.go
newThresholdCaches
func newThresholdCaches(numCaches uint32) []thresholdStateCache { caches := make([]thresholdStateCache, numCaches) for i := 0; i < len(caches); i++ { caches[i] = thresholdStateCache{ entries: make(map[chainhash.Hash]ThresholdState), } } return caches }
go
func newThresholdCaches(numCaches uint32) []thresholdStateCache { caches := make([]thresholdStateCache, numCaches) for i := 0; i < len(caches); i++ { caches[i] = thresholdStateCache{ entries: make(map[chainhash.Hash]ThresholdState), } } return caches }
[ "func", "newThresholdCaches", "(", "numCaches", "uint32", ")", "[", "]", "thresholdStateCache", "{", "caches", ":=", "make", "(", "[", "]", "thresholdStateCache", ",", "numCaches", ")", "\n", "for", "i", ":=", "0", ";", "i", "<", "len", "(", "caches", ")...
// newThresholdCaches returns a new array of caches to be used when calculating // threshold states.
[ "newThresholdCaches", "returns", "a", "new", "array", "of", "caches", "to", "be", "used", "when", "calculating", "threshold", "states", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/thresholdstate.go#L114-L122
162,862
btcsuite/btcd
blockchain/thresholdstate.go
ThresholdState
func (b *BlockChain) ThresholdState(deploymentID uint32) (ThresholdState, error) { b.chainLock.Lock() state, err := b.deploymentState(b.bestChain.Tip(), deploymentID) b.chainLock.Unlock() return state, err }
go
func (b *BlockChain) ThresholdState(deploymentID uint32) (ThresholdState, error) { b.chainLock.Lock() state, err := b.deploymentState(b.bestChain.Tip(), deploymentID) b.chainLock.Unlock() return state, err }
[ "func", "(", "b", "*", "BlockChain", ")", "ThresholdState", "(", "deploymentID", "uint32", ")", "(", "ThresholdState", ",", "error", ")", "{", "b", ".", "chainLock", ".", "Lock", "(", ")", "\n", "state", ",", "err", ":=", "b", ".", "deploymentState", "...
// ThresholdState returns the current rule change threshold state of the given // deployment ID for the block AFTER the end of the current best chain. // // This function is safe for concurrent access.
[ "ThresholdState", "returns", "the", "current", "rule", "change", "threshold", "state", "of", "the", "given", "deployment", "ID", "for", "the", "block", "AFTER", "the", "end", "of", "the", "current", "best", "chain", ".", "This", "function", "is", "safe", "fo...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/thresholdstate.go#L266-L272
162,863
btcsuite/btcd
blockchain/thresholdstate.go
IsDeploymentActive
func (b *BlockChain) IsDeploymentActive(deploymentID uint32) (bool, error) { b.chainLock.Lock() state, err := b.deploymentState(b.bestChain.Tip(), deploymentID) b.chainLock.Unlock() if err != nil { return false, err } return state == ThresholdActive, nil }
go
func (b *BlockChain) IsDeploymentActive(deploymentID uint32) (bool, error) { b.chainLock.Lock() state, err := b.deploymentState(b.bestChain.Tip(), deploymentID) b.chainLock.Unlock() if err != nil { return false, err } return state == ThresholdActive, nil }
[ "func", "(", "b", "*", "BlockChain", ")", "IsDeploymentActive", "(", "deploymentID", "uint32", ")", "(", "bool", ",", "error", ")", "{", "b", ".", "chainLock", ".", "Lock", "(", ")", "\n", "state", ",", "err", ":=", "b", ".", "deploymentState", "(", ...
// IsDeploymentActive returns true if the target deploymentID is active, and // false otherwise. // // This function is safe for concurrent access.
[ "IsDeploymentActive", "returns", "true", "if", "the", "target", "deploymentID", "is", "active", "and", "false", "otherwise", ".", "This", "function", "is", "safe", "for", "concurrent", "access", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/thresholdstate.go#L278-L287
162,864
btcsuite/btcd
blockchain/thresholdstate.go
initThresholdCaches
func (b *BlockChain) initThresholdCaches() error { // Initialize the warning and deployment caches by calculating the // threshold state for each of them. This will ensure the caches are // populated and any states that needed to be recalculated due to // definition changes is done now. prevNode := b.bestChain.Ti...
go
func (b *BlockChain) initThresholdCaches() error { // Initialize the warning and deployment caches by calculating the // threshold state for each of them. This will ensure the caches are // populated and any states that needed to be recalculated due to // definition changes is done now. prevNode := b.bestChain.Ti...
[ "func", "(", "b", "*", "BlockChain", ")", "initThresholdCaches", "(", ")", "error", "{", "// Initialize the warning and deployment caches by calculating the", "// threshold state for each of them. This will ensure the caches are", "// populated and any states that needed to be recalculate...
// initThresholdCaches initializes the threshold state caches for each warning // bit and defined deployment and provides warnings if the chain is current per // the warnUnknownVersions and warnUnknownRuleActivations functions.
[ "initThresholdCaches", "initializes", "the", "threshold", "state", "caches", "for", "each", "warning", "bit", "and", "defined", "deployment", "and", "provides", "warnings", "if", "the", "chain", "is", "current", "per", "the", "warnUnknownVersions", "and", "warnUnkno...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/blockchain/thresholdstate.go#L314-L356
162,865
btcsuite/btcd
btcec/pubkey.go
decompressPoint
func decompressPoint(curve *KoblitzCurve, x *big.Int, ybit bool) (*big.Int, error) { // TODO: This will probably only work for secp256k1 due to // optimizations. // Y = +-sqrt(x^3 + B) x3 := new(big.Int).Mul(x, x) x3.Mul(x3, x) x3.Add(x3, curve.Params().B) x3.Mod(x3, curve.Params().P) // Now calculate sqrt mo...
go
func decompressPoint(curve *KoblitzCurve, x *big.Int, ybit bool) (*big.Int, error) { // TODO: This will probably only work for secp256k1 due to // optimizations. // Y = +-sqrt(x^3 + B) x3 := new(big.Int).Mul(x, x) x3.Mul(x3, x) x3.Add(x3, curve.Params().B) x3.Mod(x3, curve.Params().P) // Now calculate sqrt mo...
[ "func", "decompressPoint", "(", "curve", "*", "KoblitzCurve", ",", "x", "*", "big", ".", "Int", ",", "ybit", "bool", ")", "(", "*", "big", ".", "Int", ",", "error", ")", "{", "// TODO: This will probably only work for secp256k1 due to", "// optimizations.", "// ...
// decompressPoint decompresses a point on the given curve given the X point and // the solution to use.
[ "decompressPoint", "decompresses", "a", "point", "on", "the", "given", "curve", "given", "the", "X", "point", "and", "the", "solution", "to", "use", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcec/pubkey.go#L27-L60
162,866
btcsuite/btcd
btcec/pubkey.go
IsCompressedPubKey
func IsCompressedPubKey(pubKey []byte) bool { // The public key is only compressed if it is the correct length and // the format (first byte) is one of the compressed pubkey values. return len(pubKey) == PubKeyBytesLenCompressed && (pubKey[0]&^byte(0x1) == pubkeyCompressed) }
go
func IsCompressedPubKey(pubKey []byte) bool { // The public key is only compressed if it is the correct length and // the format (first byte) is one of the compressed pubkey values. return len(pubKey) == PubKeyBytesLenCompressed && (pubKey[0]&^byte(0x1) == pubkeyCompressed) }
[ "func", "IsCompressedPubKey", "(", "pubKey", "[", "]", "byte", ")", "bool", "{", "// The public key is only compressed if it is the correct length and", "// the format (first byte) is one of the compressed pubkey values.", "return", "len", "(", "pubKey", ")", "==", "PubKeyBytesLe...
// IsCompressedPubKey returns true the the passed serialized public key has // been encoded in compressed format, and false otherwise.
[ "IsCompressedPubKey", "returns", "true", "the", "the", "passed", "serialized", "public", "key", "has", "been", "encoded", "in", "compressed", "format", "and", "false", "otherwise", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcec/pubkey.go#L70-L75
162,867
btcsuite/btcd
btcec/pubkey.go
ParsePubKey
func ParsePubKey(pubKeyStr []byte, curve *KoblitzCurve) (key *PublicKey, err error) { pubkey := PublicKey{} pubkey.Curve = curve if len(pubKeyStr) == 0 { return nil, errors.New("pubkey string is empty") } format := pubKeyStr[0] ybit := (format & 0x1) == 0x1 format &= ^byte(0x1) switch len(pubKeyStr) { cas...
go
func ParsePubKey(pubKeyStr []byte, curve *KoblitzCurve) (key *PublicKey, err error) { pubkey := PublicKey{} pubkey.Curve = curve if len(pubKeyStr) == 0 { return nil, errors.New("pubkey string is empty") } format := pubKeyStr[0] ybit := (format & 0x1) == 0x1 format &= ^byte(0x1) switch len(pubKeyStr) { cas...
[ "func", "ParsePubKey", "(", "pubKeyStr", "[", "]", "byte", ",", "curve", "*", "KoblitzCurve", ")", "(", "key", "*", "PublicKey", ",", "err", "error", ")", "{", "pubkey", ":=", "PublicKey", "{", "}", "\n", "pubkey", ".", "Curve", "=", "curve", "\n\n", ...
// ParsePubKey parses a public key for a koblitz curve from a bytestring into a // ecdsa.Publickey, verifying that it is valid. It supports compressed, // uncompressed and hybrid signature formats.
[ "ParsePubKey", "parses", "a", "public", "key", "for", "a", "koblitz", "curve", "from", "a", "bytestring", "into", "a", "ecdsa", ".", "Publickey", "verifying", "that", "it", "is", "valid", ".", "It", "supports", "compressed", "uncompressed", "and", "hybrid", ...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcec/pubkey.go#L80-L133
162,868
btcsuite/btcd
btcec/pubkey.go
SerializeUncompressed
func (p *PublicKey) SerializeUncompressed() []byte { b := make([]byte, 0, PubKeyBytesLenUncompressed) b = append(b, pubkeyUncompressed) b = paddedAppend(32, b, p.X.Bytes()) return paddedAppend(32, b, p.Y.Bytes()) }
go
func (p *PublicKey) SerializeUncompressed() []byte { b := make([]byte, 0, PubKeyBytesLenUncompressed) b = append(b, pubkeyUncompressed) b = paddedAppend(32, b, p.X.Bytes()) return paddedAppend(32, b, p.Y.Bytes()) }
[ "func", "(", "p", "*", "PublicKey", ")", "SerializeUncompressed", "(", ")", "[", "]", "byte", "{", "b", ":=", "make", "(", "[", "]", "byte", ",", "0", ",", "PubKeyBytesLenUncompressed", ")", "\n", "b", "=", "append", "(", "b", ",", "pubkeyUncompressed"...
// SerializeUncompressed serializes a public key in a 65-byte uncompressed // format.
[ "SerializeUncompressed", "serializes", "a", "public", "key", "in", "a", "65", "-", "byte", "uncompressed", "format", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcec/pubkey.go#L146-L151
162,869
btcsuite/btcd
btcec/pubkey.go
SerializeCompressed
func (p *PublicKey) SerializeCompressed() []byte { b := make([]byte, 0, PubKeyBytesLenCompressed) format := pubkeyCompressed if isOdd(p.Y) { format |= 0x1 } b = append(b, format) return paddedAppend(32, b, p.X.Bytes()) }
go
func (p *PublicKey) SerializeCompressed() []byte { b := make([]byte, 0, PubKeyBytesLenCompressed) format := pubkeyCompressed if isOdd(p.Y) { format |= 0x1 } b = append(b, format) return paddedAppend(32, b, p.X.Bytes()) }
[ "func", "(", "p", "*", "PublicKey", ")", "SerializeCompressed", "(", ")", "[", "]", "byte", "{", "b", ":=", "make", "(", "[", "]", "byte", ",", "0", ",", "PubKeyBytesLenCompressed", ")", "\n", "format", ":=", "pubkeyCompressed", "\n", "if", "isOdd", "(...
// SerializeCompressed serializes a public key in a 33-byte compressed format.
[ "SerializeCompressed", "serializes", "a", "public", "key", "in", "a", "33", "-", "byte", "compressed", "format", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcec/pubkey.go#L154-L162
162,870
btcsuite/btcd
btcec/pubkey.go
SerializeHybrid
func (p *PublicKey) SerializeHybrid() []byte { b := make([]byte, 0, PubKeyBytesLenHybrid) format := pubkeyHybrid if isOdd(p.Y) { format |= 0x1 } b = append(b, format) b = paddedAppend(32, b, p.X.Bytes()) return paddedAppend(32, b, p.Y.Bytes()) }
go
func (p *PublicKey) SerializeHybrid() []byte { b := make([]byte, 0, PubKeyBytesLenHybrid) format := pubkeyHybrid if isOdd(p.Y) { format |= 0x1 } b = append(b, format) b = paddedAppend(32, b, p.X.Bytes()) return paddedAppend(32, b, p.Y.Bytes()) }
[ "func", "(", "p", "*", "PublicKey", ")", "SerializeHybrid", "(", ")", "[", "]", "byte", "{", "b", ":=", "make", "(", "[", "]", "byte", ",", "0", ",", "PubKeyBytesLenHybrid", ")", "\n", "format", ":=", "pubkeyHybrid", "\n", "if", "isOdd", "(", "p", ...
// SerializeHybrid serializes a public key in a 65-byte hybrid format.
[ "SerializeHybrid", "serializes", "a", "public", "key", "in", "a", "65", "-", "byte", "hybrid", "format", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcec/pubkey.go#L165-L174
162,871
btcsuite/btcd
btcec/pubkey.go
IsEqual
func (p *PublicKey) IsEqual(otherPubKey *PublicKey) bool { return p.X.Cmp(otherPubKey.X) == 0 && p.Y.Cmp(otherPubKey.Y) == 0 }
go
func (p *PublicKey) IsEqual(otherPubKey *PublicKey) bool { return p.X.Cmp(otherPubKey.X) == 0 && p.Y.Cmp(otherPubKey.Y) == 0 }
[ "func", "(", "p", "*", "PublicKey", ")", "IsEqual", "(", "otherPubKey", "*", "PublicKey", ")", "bool", "{", "return", "p", ".", "X", ".", "Cmp", "(", "otherPubKey", ".", "X", ")", "==", "0", "&&", "p", ".", "Y", ".", "Cmp", "(", "otherPubKey", "....
// IsEqual compares this PublicKey instance to the one passed, returning true if // both PublicKeys are equivalent. A PublicKey is equivalent to another, if they // both have the same X and Y coordinate.
[ "IsEqual", "compares", "this", "PublicKey", "instance", "to", "the", "one", "passed", "returning", "true", "if", "both", "PublicKeys", "are", "equivalent", ".", "A", "PublicKey", "is", "equivalent", "to", "another", "if", "they", "both", "have", "the", "same",...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcec/pubkey.go#L179-L182
162,872
btcsuite/btcd
btcec/pubkey.go
paddedAppend
func paddedAppend(size uint, dst, src []byte) []byte { for i := 0; i < int(size)-len(src); i++ { dst = append(dst, 0) } return append(dst, src...) }
go
func paddedAppend(size uint, dst, src []byte) []byte { for i := 0; i < int(size)-len(src); i++ { dst = append(dst, 0) } return append(dst, src...) }
[ "func", "paddedAppend", "(", "size", "uint", ",", "dst", ",", "src", "[", "]", "byte", ")", "[", "]", "byte", "{", "for", "i", ":=", "0", ";", "i", "<", "int", "(", "size", ")", "-", "len", "(", "src", ")", ";", "i", "++", "{", "dst", "=", ...
// paddedAppend appends the src byte slice to dst, returning the new slice. // If the length of the source is smaller than the passed size, leading zero // bytes are appended to the dst slice before appending src.
[ "paddedAppend", "appends", "the", "src", "byte", "slice", "to", "dst", "returning", "the", "new", "slice", ".", "If", "the", "length", "of", "the", "source", "is", "smaller", "than", "the", "passed", "size", "leading", "zero", "bytes", "are", "appended", "...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcec/pubkey.go#L187-L192
162,873
btcsuite/btcd
btcjson/helpers.go
Bool
func Bool(v bool) *bool { p := new(bool) *p = v return p }
go
func Bool(v bool) *bool { p := new(bool) *p = v return p }
[ "func", "Bool", "(", "v", "bool", ")", "*", "bool", "{", "p", ":=", "new", "(", "bool", ")", "\n", "*", "p", "=", "v", "\n", "return", "p", "\n", "}" ]
// Bool is a helper routine that allocates a new bool value to store v and // returns a pointer to it. This is useful when assigning optional parameters.
[ "Bool", "is", "a", "helper", "routine", "that", "allocates", "a", "new", "bool", "value", "to", "store", "v", "and", "returns", "a", "pointer", "to", "it", ".", "This", "is", "useful", "when", "assigning", "optional", "parameters", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/helpers.go#L9-L13
162,874
btcsuite/btcd
btcjson/helpers.go
Int
func Int(v int) *int { p := new(int) *p = v return p }
go
func Int(v int) *int { p := new(int) *p = v return p }
[ "func", "Int", "(", "v", "int", ")", "*", "int", "{", "p", ":=", "new", "(", "int", ")", "\n", "*", "p", "=", "v", "\n", "return", "p", "\n", "}" ]
// Int is a helper routine that allocates a new int value to store v and // returns a pointer to it. This is useful when assigning optional parameters.
[ "Int", "is", "a", "helper", "routine", "that", "allocates", "a", "new", "int", "value", "to", "store", "v", "and", "returns", "a", "pointer", "to", "it", ".", "This", "is", "useful", "when", "assigning", "optional", "parameters", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/helpers.go#L17-L21
162,875
btcsuite/btcd
btcjson/helpers.go
Uint
func Uint(v uint) *uint { p := new(uint) *p = v return p }
go
func Uint(v uint) *uint { p := new(uint) *p = v return p }
[ "func", "Uint", "(", "v", "uint", ")", "*", "uint", "{", "p", ":=", "new", "(", "uint", ")", "\n", "*", "p", "=", "v", "\n", "return", "p", "\n", "}" ]
// Uint is a helper routine that allocates a new uint value to store v and // returns a pointer to it. This is useful when assigning optional parameters.
[ "Uint", "is", "a", "helper", "routine", "that", "allocates", "a", "new", "uint", "value", "to", "store", "v", "and", "returns", "a", "pointer", "to", "it", ".", "This", "is", "useful", "when", "assigning", "optional", "parameters", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/helpers.go#L25-L29
162,876
btcsuite/btcd
btcjson/helpers.go
Int32
func Int32(v int32) *int32 { p := new(int32) *p = v return p }
go
func Int32(v int32) *int32 { p := new(int32) *p = v return p }
[ "func", "Int32", "(", "v", "int32", ")", "*", "int32", "{", "p", ":=", "new", "(", "int32", ")", "\n", "*", "p", "=", "v", "\n", "return", "p", "\n", "}" ]
// Int32 is a helper routine that allocates a new int32 value to store v and // returns a pointer to it. This is useful when assigning optional parameters.
[ "Int32", "is", "a", "helper", "routine", "that", "allocates", "a", "new", "int32", "value", "to", "store", "v", "and", "returns", "a", "pointer", "to", "it", ".", "This", "is", "useful", "when", "assigning", "optional", "parameters", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/helpers.go#L33-L37
162,877
btcsuite/btcd
btcjson/helpers.go
Uint32
func Uint32(v uint32) *uint32 { p := new(uint32) *p = v return p }
go
func Uint32(v uint32) *uint32 { p := new(uint32) *p = v return p }
[ "func", "Uint32", "(", "v", "uint32", ")", "*", "uint32", "{", "p", ":=", "new", "(", "uint32", ")", "\n", "*", "p", "=", "v", "\n", "return", "p", "\n", "}" ]
// Uint32 is a helper routine that allocates a new uint32 value to store v and // returns a pointer to it. This is useful when assigning optional parameters.
[ "Uint32", "is", "a", "helper", "routine", "that", "allocates", "a", "new", "uint32", "value", "to", "store", "v", "and", "returns", "a", "pointer", "to", "it", ".", "This", "is", "useful", "when", "assigning", "optional", "parameters", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/helpers.go#L41-L45
162,878
btcsuite/btcd
btcjson/helpers.go
Int64
func Int64(v int64) *int64 { p := new(int64) *p = v return p }
go
func Int64(v int64) *int64 { p := new(int64) *p = v return p }
[ "func", "Int64", "(", "v", "int64", ")", "*", "int64", "{", "p", ":=", "new", "(", "int64", ")", "\n", "*", "p", "=", "v", "\n", "return", "p", "\n", "}" ]
// Int64 is a helper routine that allocates a new int64 value to store v and // returns a pointer to it. This is useful when assigning optional parameters.
[ "Int64", "is", "a", "helper", "routine", "that", "allocates", "a", "new", "int64", "value", "to", "store", "v", "and", "returns", "a", "pointer", "to", "it", ".", "This", "is", "useful", "when", "assigning", "optional", "parameters", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/helpers.go#L49-L53
162,879
btcsuite/btcd
btcjson/helpers.go
Uint64
func Uint64(v uint64) *uint64 { p := new(uint64) *p = v return p }
go
func Uint64(v uint64) *uint64 { p := new(uint64) *p = v return p }
[ "func", "Uint64", "(", "v", "uint64", ")", "*", "uint64", "{", "p", ":=", "new", "(", "uint64", ")", "\n", "*", "p", "=", "v", "\n", "return", "p", "\n", "}" ]
// Uint64 is a helper routine that allocates a new uint64 value to store v and // returns a pointer to it. This is useful when assigning optional parameters.
[ "Uint64", "is", "a", "helper", "routine", "that", "allocates", "a", "new", "uint64", "value", "to", "store", "v", "and", "returns", "a", "pointer", "to", "it", ".", "This", "is", "useful", "when", "assigning", "optional", "parameters", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/helpers.go#L57-L61
162,880
btcsuite/btcd
btcjson/helpers.go
Float64
func Float64(v float64) *float64 { p := new(float64) *p = v return p }
go
func Float64(v float64) *float64 { p := new(float64) *p = v return p }
[ "func", "Float64", "(", "v", "float64", ")", "*", "float64", "{", "p", ":=", "new", "(", "float64", ")", "\n", "*", "p", "=", "v", "\n", "return", "p", "\n", "}" ]
// Float64 is a helper routine that allocates a new float64 value to store v and // returns a pointer to it. This is useful when assigning optional parameters.
[ "Float64", "is", "a", "helper", "routine", "that", "allocates", "a", "new", "float64", "value", "to", "store", "v", "and", "returns", "a", "pointer", "to", "it", ".", "This", "is", "useful", "when", "assigning", "optional", "parameters", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/helpers.go#L65-L69
162,881
btcsuite/btcd
btcjson/helpers.go
String
func String(v string) *string { p := new(string) *p = v return p }
go
func String(v string) *string { p := new(string) *p = v return p }
[ "func", "String", "(", "v", "string", ")", "*", "string", "{", "p", ":=", "new", "(", "string", ")", "\n", "*", "p", "=", "v", "\n", "return", "p", "\n", "}" ]
// String is a helper routine that allocates a new string value to store v and // returns a pointer to it. This is useful when assigning optional parameters.
[ "String", "is", "a", "helper", "routine", "that", "allocates", "a", "new", "string", "value", "to", "store", "v", "and", "returns", "a", "pointer", "to", "it", ".", "This", "is", "useful", "when", "assigning", "optional", "parameters", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/btcjson/helpers.go#L73-L77
162,882
btcsuite/btcd
database/internal/treap/mutable.go
get
func (t *Mutable) get(key []byte) (*treapNode, *treapNode) { var parent *treapNode for node := t.root; node != nil; { // Traverse left or right depending on the result of the // comparison. compareResult := bytes.Compare(key, node.key) if compareResult < 0 { parent = node node = node.left continue ...
go
func (t *Mutable) get(key []byte) (*treapNode, *treapNode) { var parent *treapNode for node := t.root; node != nil; { // Traverse left or right depending on the result of the // comparison. compareResult := bytes.Compare(key, node.key) if compareResult < 0 { parent = node node = node.left continue ...
[ "func", "(", "t", "*", "Mutable", ")", "get", "(", "key", "[", "]", "byte", ")", "(", "*", "treapNode", ",", "*", "treapNode", ")", "{", "var", "parent", "*", "treapNode", "\n", "for", "node", ":=", "t", ".", "root", ";", "node", "!=", "nil", "...
// get returns the treap node that contains the passed key and its parent. When // the found node is the root of the tree, the parent will be nil. When the key // does not exist, both the node and the parent will be nil.
[ "get", "returns", "the", "treap", "node", "that", "contains", "the", "passed", "key", "and", "its", "parent", ".", "When", "the", "found", "node", "is", "the", "root", "of", "the", "tree", "the", "parent", "will", "be", "nil", ".", "When", "the", "key"...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/database/internal/treap/mutable.go#L42-L65
162,883
btcsuite/btcd
database/internal/treap/mutable.go
relinkGrandparent
func (t *Mutable) relinkGrandparent(node, parent, grandparent *treapNode) { // The node is now the root of the tree when there is no grandparent. if grandparent == nil { t.root = node return } // Relink the grandparent's left or right pointer based on which side // the old parent was. if grandparent.left == ...
go
func (t *Mutable) relinkGrandparent(node, parent, grandparent *treapNode) { // The node is now the root of the tree when there is no grandparent. if grandparent == nil { t.root = node return } // Relink the grandparent's left or right pointer based on which side // the old parent was. if grandparent.left == ...
[ "func", "(", "t", "*", "Mutable", ")", "relinkGrandparent", "(", "node", ",", "parent", ",", "grandparent", "*", "treapNode", ")", "{", "// The node is now the root of the tree when there is no grandparent.", "if", "grandparent", "==", "nil", "{", "t", ".", "root", ...
// relinkGrandparent relinks the node into the treap after it has been rotated // by changing the passed grandparent's left or right pointer, depending on // where the old parent was, to point at the passed node. Otherwise, when there // is no grandparent, it means the node is now the root of the tree, so update // it...
[ "relinkGrandparent", "relinks", "the", "node", "into", "the", "treap", "after", "it", "has", "been", "rotated", "by", "changing", "the", "passed", "grandparent", "s", "left", "or", "right", "pointer", "depending", "on", "where", "the", "old", "parent", "was", ...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/database/internal/treap/mutable.go#L89-L103
162,884
btcsuite/btcd
database/internal/treap/mutable.go
Delete
func (t *Mutable) Delete(key []byte) { // Find the node for the key along with its parent. There is nothing to // do if the key does not exist. node, parent := t.get(key) if node == nil { return } // When the only node in the tree is the root node and it is the one // being deleted, there is nothing else to ...
go
func (t *Mutable) Delete(key []byte) { // Find the node for the key along with its parent. There is nothing to // do if the key does not exist. node, parent := t.get(key) if node == nil { return } // When the only node in the tree is the root node and it is the one // being deleted, there is nothing else to ...
[ "func", "(", "t", "*", "Mutable", ")", "Delete", "(", "key", "[", "]", "byte", ")", "{", "// Find the node for the key along with its parent. There is nothing to", "// do if the key does not exist.", "node", ",", "parent", ":=", "t", ".", "get", "(", "key", ")", ...
// Delete removes the passed key if it exists.
[ "Delete", "removes", "the", "passed", "key", "if", "it", "exists", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/database/internal/treap/mutable.go#L179-L241
162,885
btcsuite/btcd
database/internal/treap/mutable.go
Reset
func (t *Mutable) Reset() { t.count = 0 t.totalSize = 0 t.root = nil }
go
func (t *Mutable) Reset() { t.count = 0 t.totalSize = 0 t.root = nil }
[ "func", "(", "t", "*", "Mutable", ")", "Reset", "(", ")", "{", "t", ".", "count", "=", "0", "\n", "t", ".", "totalSize", "=", "0", "\n", "t", ".", "root", "=", "nil", "\n", "}" ]
// Reset efficiently removes all items in the treap.
[ "Reset", "efficiently", "removes", "all", "items", "in", "the", "treap", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/database/internal/treap/mutable.go#L268-L272
162,886
btcsuite/btcd
database/internal/treap/immutable.go
cloneTreapNode
func cloneTreapNode(node *treapNode) *treapNode { return &treapNode{ key: node.key, value: node.value, priority: node.priority, left: node.left, right: node.right, } }
go
func cloneTreapNode(node *treapNode) *treapNode { return &treapNode{ key: node.key, value: node.value, priority: node.priority, left: node.left, right: node.right, } }
[ "func", "cloneTreapNode", "(", "node", "*", "treapNode", ")", "*", "treapNode", "{", "return", "&", "treapNode", "{", "key", ":", "node", ".", "key", ",", "value", ":", "node", ".", "value", ",", "priority", ":", "node", ".", "priority", ",", "left", ...
// cloneTreapNode returns a shallow copy of the passed node.
[ "cloneTreapNode", "returns", "a", "shallow", "copy", "of", "the", "passed", "node", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/database/internal/treap/immutable.go#L13-L21
162,887
btcsuite/btcd
database/internal/treap/immutable.go
newImmutable
func newImmutable(root *treapNode, count int, totalSize uint64) *Immutable { return &Immutable{root: root, count: count, totalSize: totalSize} }
go
func newImmutable(root *treapNode, count int, totalSize uint64) *Immutable { return &Immutable{root: root, count: count, totalSize: totalSize} }
[ "func", "newImmutable", "(", "root", "*", "treapNode", ",", "count", "int", ",", "totalSize", "uint64", ")", "*", "Immutable", "{", "return", "&", "Immutable", "{", "root", ":", "root", ",", "count", ":", "count", ",", "totalSize", ":", "totalSize", "}",...
// newImmutable returns a new immutable treap given the passed parameters.
[ "newImmutable", "returns", "a", "new", "immutable", "treap", "given", "the", "passed", "parameters", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/database/internal/treap/immutable.go#L49-L51
162,888
btcsuite/btcd
database/internal/treap/immutable.go
Delete
func (t *Immutable) Delete(key []byte) *Immutable { // Find the node for the key while constructing a list of parents while // doing so. var parents parentStack var delNode *treapNode for node := t.root; node != nil; { parents.Push(node) // Traverse left or right depending on the result of the // comparison...
go
func (t *Immutable) Delete(key []byte) *Immutable { // Find the node for the key while constructing a list of parents while // doing so. var parents parentStack var delNode *treapNode for node := t.root; node != nil; { parents.Push(node) // Traverse left or right depending on the result of the // comparison...
[ "func", "(", "t", "*", "Immutable", ")", "Delete", "(", "key", "[", "]", "byte", ")", "*", "Immutable", "{", "// Find the node for the key while constructing a list of parents while", "// doing so.", "var", "parents", "parentStack", "\n", "var", "delNode", "*", "tre...
// Delete removes the passed key from the treap and returns the resulting treap // if it exists. The original immutable treap is returned if the key does not // exist.
[ "Delete", "removes", "the", "passed", "key", "from", "the", "treap", "and", "returns", "the", "resulting", "treap", "if", "it", "exists", ".", "The", "original", "immutable", "treap", "is", "returned", "if", "the", "key", "does", "not", "exist", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/database/internal/treap/immutable.go#L214-L330
162,889
btcsuite/btcd
peer/mruinvmap.go
Exists
func (m *mruInventoryMap) Exists(iv *wire.InvVect) bool { m.invMtx.Lock() _, exists := m.invMap[*iv] m.invMtx.Unlock() return exists }
go
func (m *mruInventoryMap) Exists(iv *wire.InvVect) bool { m.invMtx.Lock() _, exists := m.invMap[*iv] m.invMtx.Unlock() return exists }
[ "func", "(", "m", "*", "mruInventoryMap", ")", "Exists", "(", "iv", "*", "wire", ".", "InvVect", ")", "bool", "{", "m", ".", "invMtx", ".", "Lock", "(", ")", "\n", "_", ",", "exists", ":=", "m", ".", "invMap", "[", "*", "iv", "]", "\n", "m", ...
// Exists returns whether or not the passed inventory item is in the map. // // This function is safe for concurrent access.
[ "Exists", "returns", "whether", "or", "not", "the", "passed", "inventory", "item", "is", "in", "the", "map", ".", "This", "function", "is", "safe", "for", "concurrent", "access", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/peer/mruinvmap.go#L51-L57
162,890
btcsuite/btcd
peer/mruinvmap.go
Add
func (m *mruInventoryMap) Add(iv *wire.InvVect) { m.invMtx.Lock() defer m.invMtx.Unlock() // When the limit is zero, nothing can be added to the map, so just // return. if m.limit == 0 { return } // When the entry already exists move it to the front of the list // thereby marking it most recently used. if ...
go
func (m *mruInventoryMap) Add(iv *wire.InvVect) { m.invMtx.Lock() defer m.invMtx.Unlock() // When the limit is zero, nothing can be added to the map, so just // return. if m.limit == 0 { return } // When the entry already exists move it to the front of the list // thereby marking it most recently used. if ...
[ "func", "(", "m", "*", "mruInventoryMap", ")", "Add", "(", "iv", "*", "wire", ".", "InvVect", ")", "{", "m", ".", "invMtx", ".", "Lock", "(", ")", "\n", "defer", "m", ".", "invMtx", ".", "Unlock", "(", ")", "\n\n", "// When the limit is zero, nothing c...
// Add adds the passed inventory to the map and handles eviction of the oldest // item if adding the new item would exceed the max limit. Adding an existing // item makes it the most recently used item. // // This function is safe for concurrent access.
[ "Add", "adds", "the", "passed", "inventory", "to", "the", "map", "and", "handles", "eviction", "of", "the", "oldest", "item", "if", "adding", "the", "new", "item", "would", "exceed", "the", "max", "limit", ".", "Adding", "an", "existing", "item", "makes", ...
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/peer/mruinvmap.go#L64-L102
162,891
btcsuite/btcd
mempool/estimatefee.go
ToBtcPerKb
func (rate SatoshiPerByte) ToBtcPerKb() BtcPerKilobyte { // If our rate is the error value, return that. if rate == SatoshiPerByte(-1.0) { return -1.0 } return BtcPerKilobyte(float64(rate) * bytePerKb * btcPerSatoshi) }
go
func (rate SatoshiPerByte) ToBtcPerKb() BtcPerKilobyte { // If our rate is the error value, return that. if rate == SatoshiPerByte(-1.0) { return -1.0 } return BtcPerKilobyte(float64(rate) * bytePerKb * btcPerSatoshi) }
[ "func", "(", "rate", "SatoshiPerByte", ")", "ToBtcPerKb", "(", ")", "BtcPerKilobyte", "{", "// If our rate is the error value, return that.", "if", "rate", "==", "SatoshiPerByte", "(", "-", "1.0", ")", "{", "return", "-", "1.0", "\n", "}", "\n\n", "return", "Btc...
// ToBtcPerKb returns a float value that represents the given // SatoshiPerByte converted to satoshis per kb.
[ "ToBtcPerKb", "returns", "a", "float", "value", "that", "represents", "the", "given", "SatoshiPerByte", "converted", "to", "satoshis", "per", "kb", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/mempool/estimatefee.go#L67-L74
162,892
btcsuite/btcd
mempool/estimatefee.go
Fee
func (rate SatoshiPerByte) Fee(size uint32) btcutil.Amount { // If our rate is the error value, return that. if rate == SatoshiPerByte(-1) { return btcutil.Amount(-1) } return btcutil.Amount(float64(rate) * float64(size)) }
go
func (rate SatoshiPerByte) Fee(size uint32) btcutil.Amount { // If our rate is the error value, return that. if rate == SatoshiPerByte(-1) { return btcutil.Amount(-1) } return btcutil.Amount(float64(rate) * float64(size)) }
[ "func", "(", "rate", "SatoshiPerByte", ")", "Fee", "(", "size", "uint32", ")", "btcutil", ".", "Amount", "{", "// If our rate is the error value, return that.", "if", "rate", "==", "SatoshiPerByte", "(", "-", "1", ")", "{", "return", "btcutil", ".", "Amount", ...
// Fee returns the fee for a transaction of a given size for // the given fee rate.
[ "Fee", "returns", "the", "fee", "for", "a", "transaction", "of", "a", "given", "size", "for", "the", "given", "fee", "rate", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/mempool/estimatefee.go#L78-L85
162,893
btcsuite/btcd
mempool/estimatefee.go
NewSatoshiPerByte
func NewSatoshiPerByte(fee btcutil.Amount, size uint32) SatoshiPerByte { return SatoshiPerByte(float64(fee) / float64(size)) }
go
func NewSatoshiPerByte(fee btcutil.Amount, size uint32) SatoshiPerByte { return SatoshiPerByte(float64(fee) / float64(size)) }
[ "func", "NewSatoshiPerByte", "(", "fee", "btcutil", ".", "Amount", ",", "size", "uint32", ")", "SatoshiPerByte", "{", "return", "SatoshiPerByte", "(", "float64", "(", "fee", ")", "/", "float64", "(", "size", ")", ")", "\n", "}" ]
// NewSatoshiPerByte creates a SatoshiPerByte from an Amount and a // size in bytes.
[ "NewSatoshiPerByte", "creates", "a", "SatoshiPerByte", "from", "an", "Amount", "and", "a", "size", "in", "bytes", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/mempool/estimatefee.go#L89-L91
162,894
btcsuite/btcd
mempool/estimatefee.go
NewFeeEstimator
func NewFeeEstimator(maxRollback, minRegisteredBlocks uint32) *FeeEstimator { return &FeeEstimator{ maxRollback: maxRollback, minRegisteredBlocks: minRegisteredBlocks, lastKnownHeight: mining.UnminedHeight, binSize: estimateFeeBinSize, maxReplacements: estimateFeeMaxReplacements, ...
go
func NewFeeEstimator(maxRollback, minRegisteredBlocks uint32) *FeeEstimator { return &FeeEstimator{ maxRollback: maxRollback, minRegisteredBlocks: minRegisteredBlocks, lastKnownHeight: mining.UnminedHeight, binSize: estimateFeeBinSize, maxReplacements: estimateFeeMaxReplacements, ...
[ "func", "NewFeeEstimator", "(", "maxRollback", ",", "minRegisteredBlocks", "uint32", ")", "*", "FeeEstimator", "{", "return", "&", "FeeEstimator", "{", "maxRollback", ":", "maxRollback", ",", "minRegisteredBlocks", ":", "minRegisteredBlocks", ",", "lastKnownHeight", "...
// NewFeeEstimator creates a FeeEstimator for which at most maxRollback blocks // can be unregistered and which returns an error unless minRegisteredBlocks // have been registered with it.
[ "NewFeeEstimator", "creates", "a", "FeeEstimator", "for", "which", "at", "most", "maxRollback", "blocks", "can", "be", "unregistered", "and", "which", "returns", "an", "error", "unless", "minRegisteredBlocks", "have", "been", "registered", "with", "it", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/mempool/estimatefee.go#L186-L196
162,895
btcsuite/btcd
mempool/estimatefee.go
ObserveTransaction
func (ef *FeeEstimator) ObserveTransaction(t *TxDesc) { ef.mtx.Lock() defer ef.mtx.Unlock() // If we haven't seen a block yet we don't know when this one arrived, // so we ignore it. if ef.lastKnownHeight == mining.UnminedHeight { return } hash := *t.Tx.Hash() if _, ok := ef.observed[hash]; !ok { size := ...
go
func (ef *FeeEstimator) ObserveTransaction(t *TxDesc) { ef.mtx.Lock() defer ef.mtx.Unlock() // If we haven't seen a block yet we don't know when this one arrived, // so we ignore it. if ef.lastKnownHeight == mining.UnminedHeight { return } hash := *t.Tx.Hash() if _, ok := ef.observed[hash]; !ok { size := ...
[ "func", "(", "ef", "*", "FeeEstimator", ")", "ObserveTransaction", "(", "t", "*", "TxDesc", ")", "{", "ef", ".", "mtx", ".", "Lock", "(", ")", "\n", "defer", "ef", ".", "mtx", ".", "Unlock", "(", ")", "\n\n", "// If we haven't seen a block yet we don't kno...
// ObserveTransaction is called when a new transaction is observed in the mempool.
[ "ObserveTransaction", "is", "called", "when", "a", "new", "transaction", "is", "observed", "in", "the", "mempool", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/mempool/estimatefee.go#L199-L220
162,896
btcsuite/btcd
mempool/estimatefee.go
RegisterBlock
func (ef *FeeEstimator) RegisterBlock(block *btcutil.Block) error { ef.mtx.Lock() defer ef.mtx.Unlock() // The previous sorted list is invalid, so delete it. ef.cached = nil height := block.Height() if height != ef.lastKnownHeight+1 && ef.lastKnownHeight != mining.UnminedHeight { return fmt.Errorf("intermedia...
go
func (ef *FeeEstimator) RegisterBlock(block *btcutil.Block) error { ef.mtx.Lock() defer ef.mtx.Unlock() // The previous sorted list is invalid, so delete it. ef.cached = nil height := block.Height() if height != ef.lastKnownHeight+1 && ef.lastKnownHeight != mining.UnminedHeight { return fmt.Errorf("intermedia...
[ "func", "(", "ef", "*", "FeeEstimator", ")", "RegisterBlock", "(", "block", "*", "btcutil", ".", "Block", ")", "error", "{", "ef", ".", "mtx", ".", "Lock", "(", ")", "\n", "defer", "ef", ".", "mtx", ".", "Unlock", "(", ")", "\n\n", "// The previous s...
// RegisterBlock informs the fee estimator of a new block to take into account.
[ "RegisterBlock", "informs", "the", "fee", "estimator", "of", "a", "new", "block", "to", "take", "into", "account", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/mempool/estimatefee.go#L223-L327
162,897
btcsuite/btcd
mempool/estimatefee.go
LastKnownHeight
func (ef *FeeEstimator) LastKnownHeight() int32 { ef.mtx.Lock() defer ef.mtx.Unlock() return ef.lastKnownHeight }
go
func (ef *FeeEstimator) LastKnownHeight() int32 { ef.mtx.Lock() defer ef.mtx.Unlock() return ef.lastKnownHeight }
[ "func", "(", "ef", "*", "FeeEstimator", ")", "LastKnownHeight", "(", ")", "int32", "{", "ef", ".", "mtx", ".", "Lock", "(", ")", "\n", "defer", "ef", ".", "mtx", ".", "Unlock", "(", ")", "\n\n", "return", "ef", ".", "lastKnownHeight", "\n", "}" ]
// LastKnownHeight returns the height of the last block which was registered.
[ "LastKnownHeight", "returns", "the", "height", "of", "the", "last", "block", "which", "was", "registered", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/mempool/estimatefee.go#L330-L335
162,898
btcsuite/btcd
mempool/estimatefee.go
rollback
func (ef *FeeEstimator) rollback() { // The previous sorted list is invalid, so delete it. ef.cached = nil // pop the last list of dropped txs from the stack. last := len(ef.dropped) - 1 if last == -1 { // Cannot really happen because the exported calling function // only rolls back a block already known to b...
go
func (ef *FeeEstimator) rollback() { // The previous sorted list is invalid, so delete it. ef.cached = nil // pop the last list of dropped txs from the stack. last := len(ef.dropped) - 1 if last == -1 { // Cannot really happen because the exported calling function // only rolls back a block already known to b...
[ "func", "(", "ef", "*", "FeeEstimator", ")", "rollback", "(", ")", "{", "// The previous sorted list is invalid, so delete it.", "ef", ".", "cached", "=", "nil", "\n\n", "// pop the last list of dropped txs from the stack.", "last", ":=", "len", "(", "ef", ".", "dropp...
// rollback rolls back the effect of the last block in the stack // of registered blocks.
[ "rollback", "rolls", "back", "the", "effect", "of", "the", "last", "block", "in", "the", "stack", "of", "registered", "blocks", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/mempool/estimatefee.go#L371-L454
162,899
btcsuite/btcd
mempool/estimatefee.go
estimateFee
func (b *estimateFeeSet) estimateFee(confirmations int) SatoshiPerByte { if confirmations <= 0 { return SatoshiPerByte(math.Inf(1)) } if confirmations > estimateFeeDepth { return 0 } // We don't have any transactions! if len(b.feeRate) == 0 { return 0 } var min, max int = 0, 0 for i := 0; i < confirma...
go
func (b *estimateFeeSet) estimateFee(confirmations int) SatoshiPerByte { if confirmations <= 0 { return SatoshiPerByte(math.Inf(1)) } if confirmations > estimateFeeDepth { return 0 } // We don't have any transactions! if len(b.feeRate) == 0 { return 0 } var min, max int = 0, 0 for i := 0; i < confirma...
[ "func", "(", "b", "*", "estimateFeeSet", ")", "estimateFee", "(", "confirmations", "int", ")", "SatoshiPerByte", "{", "if", "confirmations", "<=", "0", "{", "return", "SatoshiPerByte", "(", "math", ".", "Inf", "(", "1", ")", ")", "\n", "}", "\n\n", "if",...
// estimateFee returns the estimated fee for a transaction // to confirm in confirmations blocks from now, given // the data set we have collected.
[ "estimateFee", "returns", "the", "estimated", "fee", "for", "a", "transaction", "to", "confirm", "in", "confirmations", "blocks", "from", "now", "given", "the", "data", "set", "we", "have", "collected", "." ]
96897255fd17525dd12426345d279533780bc4e1
https://github.com/btcsuite/btcd/blob/96897255fd17525dd12426345d279533780bc4e1/mempool/estimatefee.go#L476-L505