Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cruzbit/cruzbit
/ functions
Functions
346 in github.com/cruzbit/cruzbit
⨍
Functions
346
◇
Types & classes
70
↓ 53 callers
Method
String
String implements the Stringer interface
block.go:225
↓ 33 callers
Method
Add
Add adds the transaction to the queue. Returns true if the transaction was added to the queue on this call.
transaction_queue.go:9
↓ 29 callers
Method
Close
Close is called to close any underlying storage.
ledger_disk.go:906
↓ 25 callers
Method
ID
ID computes an ID for a given block.
block.go:76
↓ 20 callers
Method
Get
Get returns some peers for us to attempt to connect to.
peer_storage.go:12
↓ 17 callers
Function
roundFloat
From: https://groups.google.com/forum/#!topic/golang-nuts/ITZV08gAugI
wallet/main.go:822
↓ 16 callers
Method
IsCoinbase
IsCoinbase returns true if the transaction is a coinbase. A coinbase is the first transaction in every block used to reward the miner for mining the b
transaction.go:88
↓ 16 callers
Method
Read
the sha3 state objects aren't exported from stdlib but some of their methods like Read are. we can get the sum without the clone done by Sum which sav
block_header_hasher.go:51
↓ 15 callers
Method
Delete
Delete is called to explicitly remove a peer address from storage.
peer_storage.go:18
↓ 15 callers
Method
GetBlockHeader
GetBlockHeader returns the referenced block's header and the timestamp of when it was stored.
block_storage.go:18
↓ 14 callers
Method
Len
Len returns the queue length.
transaction_queue.go:30
↓ 14 callers
Method
Remove
Remove removes the block ID from the queue only if the requester is who is currently responsible for its download.
block_queue.go:62
↓ 14 callers
Function
computePubKeyTransactionIndexKey
( pubKey ed25519.PublicKey, height *int64, index *int)
ledger_disk.go:972
↓ 12 callers
Method
GetBigInt
GetBigInt converts from BlockID to big.Int.
block.go:262
↓ 8 callers
Method
GetKeys
GetKeys returns all of the public keys from the database.
wallet.go:160
↓ 8 callers
Function
decryptPrivateKey
NaCl secretbox decrypt a private key with an Argon2id key derived from passphrase
wallet.go:650
↓ 7 callers
Method
Close
Close is called to close any underlying storage.
block_storage_disk.go:224
↓ 7 callers
Method
GetTransaction
GetTransaction returns a transaction within a block and the block's header.
block_storage.go:21
↓ 7 callers
Function
IsInitialBlockDownload
IsInitialBlockDownload returns true if it appears we're still syncing the block chain.
peer_manager.go:798
↓ 7 callers
Method
SetBigInt
SetBigInt converts from big.Int to BlockID.
block.go:249
↓ 7 callers
Method
Verify
Verify is called to verify only that the transaction is properly signed.
transaction.go:78
↓ 7 callers
Function
compareIDs
(block *Block)
block_header_hasher_test.go:119
↓ 7 callers
Function
computeMaxTransactionsPerBlock
Computes the maximum number of transactions allowed in a block at the given height. Inspired by BIP 101
processor.go:540
↓ 7 callers
Function
encodePrivateKeyDbKey
(pubKey ed25519.PublicKey)
wallet.go:601
↓ 6 callers
Function
BlockCreationReward
BlockCreationReward computes the expected block reward for the given height.
processor.go:672
↓ 6 callers
Method
GetBlockIDForHeight
GetBlockIDForHeight returns the ID of the block at the given block chain height.
ledger_disk.go:66
↓ 6 callers
Method
GetBlockIDForHeight
GetBlockIDForHeight returns the ID of the block at the given block chain height.
ledger.go:31
↓ 6 callers
Method
GetBranchType
GetBranchType returns the branch type for the given block.
ledger.go:37
↓ 6 callers
Function
NewTransaction
NewTransaction returns a new unsigned transaction.
transaction.go:40
↓ 6 callers
Method
Sign
Sign is called to sign a transaction.
transaction.go:68
↓ 6 callers
Method
Store
Store stores a peer address. Returns true if the peer was newly added to storage.
peer_storage.go:9
↓ 6 callers
Function
computeLastAttemptTimeKey
(when int64, addr string)
peer_storage_disk.go:448
↓ 6 callers
Function
getChainTipHeader
Convenience method to get the current main chain's tip ID, header, and storage time.
processor.go:975
↓ 6 callers
Function
getPeerInfo
Helper to lookup peer info
peer_storage_disk.go:296
↓ 5 callers
Method
GetBlock
Get returns the referenced block.
block_storage.go:12
↓ 5 callers
Method
GetChainTip
GetChainTip returns the ID and the height of the block at the current tip of the main chain.
ledger.go:28
↓ 5 callers
Method
GetPublicKeyBalance
GetPublicKeyBalance returns the current balance of a given public key.
ledger.go:48
↓ 5 callers
Function
computeLastSuccessTimeKey
(when int64, addr string)
peer_storage_disk.go:474
↓ 5 callers
Function
computePubKeyBalanceKey
(pubKey ed25519.PublicKey)
ledger_disk.go:1017
↓ 5 callers
Function
computeTransactionIndexKey
(id TransactionID)
ledger_disk.go:961
↓ 4 callers
Method
GetChainTip
GetChainTip returns the ID and the height of the block at the current tip of the main chain.
ledger_disk.go:35
↓ 4 callers
Method
Peek
Peek returns the ID of the block at the front of the queue.
block_queue.go:85
↓ 4 callers
Method
ProcessBlock
ProcessBlock is called to process a new candidate block chain tip.
processor.go:156
↓ 4 callers
Method
Shutdown
Shutdown stops the peer manager synchronously.
peer_manager.go:261
↓ 4 callers
Function
computeBranchTypeKey
(id BlockID)
ledger_disk.go:931
↓ 4 callers
Function
computeMedianTimestamp
Compute the median timestamp of the last NUM_BLOCKS_FOR_MEDIAN_TIMESTAMP blocks
processor.go:796
↓ 4 callers
Function
getBlockIDForHeight
Sometimes we call this with *leveldb.DB or *leveldb.Snapshot
ledger_disk.go:71
↓ 4 callers
Method
outboundPeerCount
()
peer_manager.go:299
↓ 3 callers
Method
Apply
Apply applies the effect of the transaction to the invovled parties' cached balances. It returns false if sender balance would go negative as a result
balance_cache.go:34
↓ 3 callers
Method
Contains
Contains returns true if the transaction is relevant to the given public key.
transaction.go:93
↓ 3 callers
Method
Exists
Exists returns true if the given transaction is in the queue.
transaction_queue.go:24
↓ 3 callers
Method
GetTipHeader
GetTipHeader returns the current tip of the main chain's header.
wallet.go:260
↓ 3 callers
Method
ID
ID computes an ID for a given transaction.
transaction.go:56
↓ 3 callers
Method
IsConnected
IsConnected returns true if the wallet is connected to a peer.
wallet.go:217
↓ 3 callers
Method
IsExpired
IsExpired returns true if the transaction cannot be mined at the given height.
transaction.go:111
↓ 3 callers
Method
IsMature
IsMature returns true if the transaction can be mined at the given height.
transaction.go:103
↓ 3 callers
Function
NewBalanceCache
NewBalanceCache returns a new instance of a BalanceCache.
balance_cache.go:20
↓ 3 callers
Function
NewBlock
SHA3-256 hash NewBlock creates and returns a new Block to be mined.
block.go:43
↓ 3 callers
Function
NewBlockQueue
NewBlockQueue returns a new instance of a BlockQueue.
block_queue.go:29
↓ 3 callers
Method
OnConnectSuccess
OnConnectSuccess is called upon successful handshake with the peer.
peer_storage.go:24
↓ 3 callers
Method
Reset
Reset resets the balance cache.
balance_cache.go:27
↓ 3 callers
Method
SetFilter
SetFilter sets the filter for the connection.
wallet.go:288
↓ 3 callers
Function
checkTransactionSeries
The series must be within the acceptable range given the current height
processor.go:374
↓ 3 callers
Function
computeBlockHeightIndexKey
(height int64)
ledger_disk.go:942
↓ 3 callers
Function
computeChainTipKey
()
ledger_disk.go:953
↓ 3 callers
Function
computePeerKey
(addr string)
peer_storage_disk.go:437
↓ 3 callers
Method
connect
Connect to a peer
peer_manager.go:403
↓ 3 callers
Method
connectBlock
Update the ledger and transaction queue and notify new tip channels
processor.go:933
↓ 3 callers
Method
connectToPeers
Try connecting to some recent peers
peer_manager.go:306
↓ 3 callers
Method
createNewWorkBlock
Create a new work block for a mining peer. Called from the writer goroutine loop.
peer.go:1589
↓ 3 callers
Function
decodePubKeyTransactionIndexKey
(key []byte)
ledger_disk.go:997
↓ 3 callers
Function
encryptPrivateKey
encryption utility functions NaCl secretbox encrypt a private key with an Argon2id key derived from passphrase
wallet.go:627
↓ 3 callers
Method
filterLookup
Returns true if the transaction is of interest to the peer
peer.go:1481
↓ 3 callers
Method
processDownloadQueue
Try requesting blocks that are in the download queue
peer.go:949
↓ 3 callers
Method
sendFindCommonAncestor
Send a message to look for a common ancestor with a peer Might be called from reader or writer context. writeNow means we're in the writer context
peer.go:1004
↓ 3 callers
Function
showTransaction
(w *Wallet, tx *Transaction, height int64)
wallet/main.go:740
↓ 3 callers
Method
writeToBatch
Helper to write the peer info to a batch
peer_storage_disk.go:405
↓ 2 callers
Method
AddTransaction
AddTransaction adds a new transaction to the block. Called by miner when mining a new block.
block.go:86
↓ 2 callers
Method
Balances
Balances returns the underlying cache of balances.
balance_cache.go:112
↓ 2 callers
Method
Close
Close is called to close any underlying storage.
peer_storage_disk.go:291
↓ 2 callers
Method
GetBlock
Get returns the referenced block.
block_storage_disk.go:121
↓ 2 callers
Method
GetBlockBytes
GetBlockBytes returns the referenced block as a byte slice.
block_storage_disk.go:136
↓ 2 callers
Method
GetPublicKeyBalances
GetPublicKeyBalances returns the current balance of the given public keys along with block ID and height of the corresponding main chain tip.
ledger.go:52
↓ 2 callers
Method
GetSince
GetSince returns some peers to tell others about last active less than "when" ago.
peer_storage.go:15
↓ 2 callers
Method
GetTransactionIndex
GetTransactionIndex returns the index of a processed transaction.
ledger.go:56
↓ 2 callers
Function
HandlePortForward
HandlePortForward manages port (un)forwarding using UPnP.
upnp.go:11
↓ 2 callers
Method
IDFast
IDFast computes an ID for a given block header when mining.
block.go:182
↓ 2 callers
Function
NewBlockStorageDisk
NewBlockStorageDisk returns a new instance of on-disk block storage.
block_storage_disk.go:34
↓ 2 callers
Method
NewKeys
NewKeys generates, encrypts and stores new private keys and returns the public keys.
wallet.go:92
↓ 2 callers
Function
NewLedgerDisk
NewLedgerDisk returns a new instance of LedgerDisk.
ledger_disk.go:25
↓ 2 callers
Function
NewPeer
NewPeer returns a new instance of a peer.
peer.go:61
↓ 2 callers
Method
OnClose
OnClose specifies a handler to call when the peer connection is closed.
peer.go:133
↓ 2 callers
Method
OnDisconnect
OnDisconnect is called upon disconnection.
peer_storage.go:30
↓ 2 callers
Method
RegisterForNewTransactions
RegisterForNewTransactions is called to register to receive notifications of newly queued transactions.
processor.go:163
↓ 2 callers
Method
RegisterForTipChange
RegisterForTipChange is called to register to receive notifications of tip block changes.
processor.go:173
↓ 2 callers
Method
Run
Run executes the peer's main loop in its own goroutine. It manages reading and writing to the peer's WebSocket and facilitating the protocol.
peer.go:184
↓ 2 callers
Method
Shutdown
Shutdown stops the processor synchronously.
processor.go:183
↓ 2 callers
Method
UnregisterForNewTransactions
UnregisterForNewTransactions is called to unregister to receive notifications of newly queued transactions
processor.go:168
↓ 2 callers
Method
UnregisterForTipChange
UnregisterForTipChange is called to unregister to receive notifications of tip block changes.
processor.go:178
↓ 2 callers
Method
acceptBlockContinue
Continue accepting the block
processor.go:816
next →
1–100 of 346, ranked by callers