Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/blkchain/blkchain
/ functions
Functions
167 in github.com/blkchain/blkchain
⨍
Functions
167
◇
Types & classes
38
↓ 42 callers
Method
Exec
(query string, args ...interface{})
db/postgres.go:1002
↓ 30 callers
Function
BinRead
BinRead will see if BinReader interface is provided, otherwise it falls back to LittleEndian binary.Read.
binary.go:32
↓ 18 callers
Function
BinWrite
Similar to BinRead, check for BinWriter, defer to binary.Write.
binary.go:40
↓ 16 callers
Method
Hash
()
tx.go:17
↓ 13 callers
Method
Close
()
block_header.go:32
↓ 11 callers
Method
Write
(p []byte)
btcnode/log.go:15
↓ 11 callers
Function
compactSizeSize
(i uint64)
binary.go:74
↓ 10 callers
Function
begin
(db *sql.DB, table string, cols []string)
db/postgres.go:869
↓ 10 callers
Function
commit
(stmt *sql.Stmt, txn *sql.Tx, misses []*prevoutMiss)
db/postgres.go:888
↓ 8 callers
Method
Next
()
block_header.go:29
↓ 8 callers
Method
Size
()
tx.go:31
↓ 7 callers
Method
String
()
uint256.go:14
↓ 6 callers
Method
Query
(query string, args ...any)
db/postgres.go:1003
↓ 6 callers
Method
Scan
Satisfy sql.Scanner
uint32.go:8
↓ 5 callers
Method
Count
()
block_header.go:27
↓ 4 callers
Method
BaseSize
()
tx.go:23
↓ 4 callers
Method
Weight
()
tx.go:39
↓ 4 callers
Function
readList
(r io.Reader, doRead func(io.Reader) error)
binary.go:133
↓ 3 callers
Function
ReadVarInt
This is equivalent of serialize.h:ReadVarInt() https://github.com/bitcoin/bitcoin/blob/0.15/src/serialize.h#L334 The origin of this encoding is not cl
binary.go:165
↓ 3 callers
Method
Size
()
block.go:23
↓ 3 callers
Method
Uptime
()
db/postgres.go:112
↓ 3 callers
Method
VirtualSize
()
tx.go:50
↓ 3 callers
Function
getHeightAndHashes
(db *sql.DB, back int)
db/postgres.go:922
↓ 3 callers
Function
readCompactSize
(r io.Reader)
binary.go:47
↓ 3 callers
Function
readString
(r io.Reader)
binary.go:110
↓ 3 callers
Function
writeList
(w io.Writer, size int, doWrite func(io.Writer, int) error)
binary.go:147
↓ 3 callers
Function
writeString
(s []byte, w io.Writer)
binary.go:125
↓ 2 callers
Method
BaseSize
()
tx_in.go:17
↓ 2 callers
Method
Close
()
db/postgres.go:107
↓ 2 callers
Function
ConnectToNode
(addr string, tmout time.Duration)
btcnode/btcnode.go:281
↓ 2 callers
Method
CurrentHeight
()
block_header.go:28
↓ 2 callers
Method
HeightAndHashes
(back int)
db/postgres.go:130
↓ 2 callers
Function
NewPGWriter
(connstr string, cacheSize int, utxo isUTXOer, zfsDataset string, parallel int)
db/postgres.go:41
↓ 2 callers
Method
SetOrphans
Set the orphan status starting from the highest block and going backwards, up to limit. If limit is 0, the whole table is updated. The WITH RECURSIVE
db/postgres.go:1613
↓ 2 callers
Function
ShaSha256
NB: we interpret this as little-endian. Traditionally Bitcoin transaction ids are printed in big-endian, i.e. reverse of this.
uint256.go:38
↓ 2 callers
Method
WriteBlock
(b *BlockRec, sync bool)
db/postgres.go:116
↓ 2 callers
Method
add
(hash blkchain.Uint256, id int64, cnt int)
db/txidcache.go:136
↓ 2 callers
Method
blockHeader
()
coredb/leveldb.go:117
↓ 2 callers
Function
fixPrevoutTxId
Most of the prevout_tx_id's should be already set during the import, but we need to correct the remaining ones. You can likely avoid it by increasing
db/postgres.go:1086
↓ 2 callers
Method
getBlock
Get a block from the node
btcnode/btcnode.go:228
↓ 2 callers
Function
processBlocks
(writer *db.PGWriter, bhs blkchain.BlockHeaderIndex, sync bool, interrupt chan bool)
cmd/import/import.go:303
↓ 2 callers
Method
reportStats
(cols bool)
db/txidcache.go:197
↓ 2 callers
Function
takeSnapshot
(db *sql.DB, dataset string, height int, tag string)
db/postgres.go:1735
↓ 2 callers
Function
writeCompactSize
(i uint64, w io.Writer)
binary.go:87
↓ 1 callers
Method
BaseSize
()
block.go:19
↓ 1 callers
Method
BinRead
(io.Reader)
binary.go:24
↓ 1 callers
Method
BinWrite
(io.Writer)
binary.go:27
↓ 1 callers
Method
BlockHeader
()
block_header.go:30
↓ 1 callers
Method
BlockHeader
()
btcnode/btcnode.go:59
↓ 1 callers
Method
Hash
()
block_header.go:16
↓ 1 callers
Method
IsUTXO
(blkchain.Uint256, uint32)
db/postgres.go:38
↓ 1 callers
Function
NewChainStateChecker
(path string)
coredb/leveldb.go:229
↓ 1 callers
Method
ReadBlock
()
block_header.go:31
↓ 1 callers
Function
ReadBtcnodeBlockHeaderIndex
(addr string, tmout time.Duration, hashes map[int][]blkchain.Uint256)
btcnode/btcnode.go:266
↓ 1 callers
Function
ReadLevelDbBlockHeaderIndex
Returns a levelDbBlockHeaderIndex over which we can iterate with Next(). Some heights have multiple blocks. This func removes orphans (TODO - why do w
coredb/leveldb.go:174
↓ 1 callers
Function
SetRLimit
(requiredParam uint64)
rlimit/rlimit_freebsd.go:11
↓ 1 callers
Method
Size
()
tx_out.go:10
↓ 1 callers
Method
Size
()
tx_in.go:24
↓ 1 callers
Function
Uint256FromBytes
(from []byte)
uint256.go:43
↓ 1 callers
Method
WaitForBlock
Wait for inventory of block(s) from the node.
btcnode/btcnode.go:348
↓ 1 callers
Function
WriteVarInt
https://github.com/bitcoin/bitcoin/blob/0.15/src/serialize.h#L317
binary.go:188
↓ 1 callers
Method
addRing
Returns cached id if it is recent, otherwise -1
db/txidcache.go:92
↓ 1 callers
Method
binWriteWithoutWitness
(w io.Writer)
tx.go:144
↓ 1 callers
Function
blockFromMsgBlock
(mb *wire.MsgBlock, magic uint32)
btcnode/btcnode.go:208
↓ 1 callers
Function
btcNodeCatchUp
(writer *db.PGWriter, addr string, tmout time.Duration, cacheSize int, interrupt chan bool)
cmd/import/import.go:140
↓ 1 callers
Method
check
Note that check is destructive, see comment at the top.
db/txidcache.go:174
↓ 1 callers
Method
checkSize
()
db/txidcache.go:125
↓ 1 callers
Method
clear
()
db/txidcache.go:87
↓ 1 callers
Function
clearPrevoutMissTable
(db execer)
db/postgres.go:1020
↓ 1 callers
Function
createConstraints
(db *sql.DB, verbose bool)
db/postgres.go:1527
↓ 1 callers
Function
createIndexes1
Create indexes only necessary to run fixPrevoutTxId(). Since we are updating txins, a presense of the txins(addr_prefix(... index would slow the updat
db/postgres.go:1244
↓ 1 callers
Function
createIndexes2
(db *sql.DB, verbose bool)
db/postgres.go:1274
↓ 1 callers
Function
createPgcrypto
(db *sql.DB)
db/postgres.go:1235
↓ 1 callers
Function
createPrevoutMissTable
(db execer)
db/postgres.go:1006
↓ 1 callers
Function
createTables
(db *sql.DB)
db/postgres.go:1153
↓ 1 callers
Function
createTxinsTriggers
(db *sql.DB)
db/postgres.go:1664
↓ 1 callers
Function
decompressAmount
This is copied from C++ https://github.com/bitcoin/bitcoin/blob/0.15/src/compressor.cpp#L161
coredb/utxo.go:95
↓ 1 callers
Function
decompressScript
https://github.com/bitcoin/bitcoin/blob/0.15/src/compressor.cpp#L88
coredb/utxo.go:129
↓ 1 callers
Function
dropPrevoutMissTable
(db *sql.DB)
db/postgres.go:1025
↓ 1 callers
Function
eliminateOrphans
Eliminate orphans by walking the chan backwards and whenever we see more than one block at a height, picking the one that matches its descendant's Pre
coredb/leveldb.go:272
↓ 1 callers
Function
eliminateOrphans
Eliminate orphans by walking the chan backwards and whenever we see more than one block at a height, picking the one that matches its descendant's Pre
btcnode/btcnode.go:402
↓ 1 callers
Function
fixPrevoutTxIdAnalyze
(db execer)
db/postgres.go:1148
↓ 1 callers
Method
getHeaders
(startHashes map[int][]blkchain.Uint256)
btcnode/btcnode.go:71
↓ 1 callers
Function
getLastBlockId
(db *sql.DB)
db/postgres.go:958
↓ 1 callers
Function
getLastTxId
(db *sql.DB)
db/postgres.go:979
↓ 1 callers
Function
getSpecialSize
https://github.com/bitcoin/bitcoin/blob/0.15/src/compressor.cpp#L79
coredb/utxo.go:118
↓ 1 callers
Function
newTxIdCache
(sz int)
db/txidcache.go:66
↓ 1 callers
Method
pgBlockWorker
(ch <-chan *BlockRec, wg *sync.WaitGroup, firstImport bool, cacheSize int, utxo isUTXOer)
db/postgres.go:134
↓ 1 callers
Function
pgBlockWriter
(c chan *BlockRec, errCh chan<- error, db *sql.DB)
db/postgres.go:478
↓ 1 callers
Function
pgTxInWriter
(c chan *txInRec, errCh chan<- error, db *sql.DB, firstImport bool)
db/postgres.go:651
↓ 1 callers
Function
pgTxOutWriter
(c chan *txOutRec, errCh chan<- error, db *sql.DB, utxo isUTXOer)
db/postgres.go:782
↓ 1 callers
Function
pgTxWriter
(c chan *txRec, errCh chan<- error, db *sql.DB)
db/postgres.go:535
↓ 1 callers
Function
prevoutMissMaxId
(db execer)
db/postgres.go:1030
↓ 1 callers
Function
processEachNewBlock
(writer *db.PGWriter, addr string, tmout time.Duration, interrupt chan bool)
cmd/import/import.go:168
↓ 1 callers
Function
processEverythingBtcNode
(dbconnect, addr string, tmout time.Duration, cacheSize int, wait bool)
cmd/import/import.go:80
↓ 1 callers
Function
processEverythingLevelDb
(dbconnect, blocksPath, indexPath, chainStatePath string, magic uint32, cacheSize int, zfsDataset string, para
cmd/import/import.go:236
↓ 1 callers
Function
readMagic
(r io.Reader)
binary.go:9
↓ 1 callers
Function
recordPrevoutMiss
(db *sql.DB, txId int64, n int, prevoutHash blkchain.Uint256)
db/postgres.go:1046
↓ 1 callers
Function
recordPrevoutMisses
(txn *sql.Tx, misses []*prevoutMiss)
db/postgres.go:1061
↓ 1 callers
Function
resetTableStorageParams
(db *sql.DB)
db/postgres.go:1225
next →
1–100 of 167, ranked by callers