new WalletDB(options)
Create a wallet db.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object |
- Source:
Members
client :NullClient|NodeClient|NodeHTTPClient
Type:
- NullClient | NodeClient | NodeHTTPClient
- Source:
db :bdb.DB
Type:
- bdb.DB
- Source:
Methods
(async, private) _addBlock(entry, txs) → {Promise.<?AddBlockResult>}
Add a block's transactions without a lock.
Parameters:
Name | Type | Description |
---|---|---|
entry |
ChainEntry | |
txs |
Array.<TX> |
- Source:
Returns:
- Type
- Promise.<?AddBlockResult>
(async, private) _addTX(tx, blockopt, extraopt) → {Promise.<?AddTXResult>}
Add a transaction to the database without a lock.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tx |
TX | ||
block |
BlockMeta |
<optional> |
|
extra |
BlockExtraInfo |
<optional> |
- Source:
Returns:
- Type
- Promise.<?AddTXResult>
(private) _bind()
Bind to node events.
- Source:
(async, private) _create(options) → {Promise.<Wallet>}
Create a new wallet, save to database without a lock.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object | See Wallet. |
- Source:
Returns:
- Type
- Promise.<Wallet>
(async) _deepClean() → {Promise.<void>}
Deep Clean (without locks): Keep all keys, account data, wallet maps (name and path). Dump all TX history and balance state. A rescan will be required but is not initiated automatically.
- Source:
Returns:
- Type
- Promise.<void>
(async, private) _get(wid) → {Promise.<?Wallet>}
Get a wallet from the database without a lock.
Parameters:
Name | Type | Description |
---|---|---|
wid |
Number |
- Source:
Returns:
- Type
- Promise.<?Wallet>
(async) _recalculateBalances() → {Promise.<void>}
Recalculate balances from the coins (without a lock).
- Source:
Returns:
- Type
- Promise.<void>
(async, private) _remove(wid) → {Promise.<Boolean>}
Remove a wallet (without a lock).
Parameters:
Name | Type | Description |
---|---|---|
wid |
Number |
- Source:
Returns:
- Type
- Promise.<Boolean>
(async, private) _removeBlock(entry) → {Promise.<Number>}
Unconfirm a block's transactions.
Parameters:
Name | Type | Description |
---|---|---|
entry |
ChainEntry |
- Source:
Returns:
- number of txs removed.
- Type
- Promise.<Number>
(async, private) _rename(wallet, id) → {Promise}
Rename a wallet without a lock.
Parameters:
Name | Type | Description |
---|---|---|
wallet |
Wallet | |
id |
String |
- Source:
Returns:
- Type
- Promise
(async, private) _rescan(height) → {Promise.<void>}
Force a rescan (without a lock).
Parameters:
Name | Type | Description |
---|---|---|
height |
Number |
- Source:
Returns:
- Type
- Promise.<void>
(async, private) _resetChain(entry) → {Promise}
Handle a chain reset without a lock.
Parameters:
Name | Type | Description |
---|---|---|
entry |
ChainEntry |
- Source:
Returns:
- Type
- Promise
(async) addBlock(entry, txs) → {Promise.<?AddBlockResult>}
Add a block's transactions and write the new best hash.
Parameters:
Name | Type | Description |
---|---|---|
entry |
ChainEntry | |
txs |
Array.<TX> |
- Source:
Returns:
- Type
- Promise.<?AddBlockResult>
(async) addBlockMap(b, height, wid) → {Promise}
Add wid to a wallet map.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
height |
Number | |
wid |
Number |
- Source:
Returns:
- Type
- Promise
(private) addFilter(data) → {Promise}
Add data to remote filter.
Parameters:
Name | Type | Description |
---|---|---|
data |
Buffer |
- Source:
Returns:
- Type
- Promise
(private) addHash(hash)
Add hash to local and remote filters.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash |
- Source:
(async) addMap(b, key, wid) → {Promise}
Add wid to a wallet map.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
key |
Buffer | |
wid |
Number |
- Source:
Returns:
- Type
- Promise
(private) addName(nameHash)
Add hash to local and remote filters.
Parameters:
Name | Type | Description |
---|---|---|
nameHash |
Hash |
- Source:
(async) addNameMap(b, nameHash, wid) → {Promise}
Add wid to a wallet map.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
nameHash |
Hash | |
wid |
Number |
- Source:
Returns:
- Type
- Promise
(private) addOutpoint(hash, index)
Add outpoint to local filter.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash | |
index |
Number |
- Source:
(async) addOutpointMap(b, hash, index, wid) → {Promise}
Add wid to a wallet map.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
hash |
Hash | |
index |
Number | |
wid |
Number |
- Source:
Returns:
- Type
- Promise
(async) addPathMap(b, hash, wid) → {Promise}
Add wid to a wallet map.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
hash |
Hash | |
wid |
Number |
- Source:
Returns:
- Type
- Promise
(async) addTX(tx) → {Promise.<?AddTXResult>}
Add a transaction to the database, map addresses to wallet IDs, potentially store orphans, resolve orphans, or confirm a transaction.
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX |
- Source:
Returns:
- Type
- Promise.<?AddTXResult>
(async) addTXMap(b, hash, wid) → {Promise}
Add wid to a wallet map.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
hash |
Hash | |
wid |
Number |
- Source:
Returns:
- Type
- Promise
(async) auth(id, token) → {Promise.<(Wallet|null)>}
Get a wallet with token auth first.
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | String | |
token |
Buffer |
- Source:
Returns:
- Type
- Promise.<(Wallet|null)>
backup(path) → {Promise}
Backup the wallet db.
Parameters:
Name | Type | Description |
---|---|---|
path |
String |
- Source:
Returns:
- Type
- Promise
(async) close() → {Promise.<void>}
Close the walletdb, wait for the database to close.
- Source:
Returns:
- Type
- Promise.<void>
(async) connect() → {Promise.<void>}
Connect to the node server (client required).
- Source:
Returns:
- Type
- Promise.<void>
(async) create(options) → {Promise.<Wallet>}
Create a new wallet, save to database, setup watcher.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object | See Wallet. |
- Source:
Returns:
- Type
- Promise.<Wallet>
(async) decryptKeys(b, wid, key) → {Promise}
Decrypt all imported keys for a wallet.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
wid |
Number | |
key |
Buffer |
- Source:
Returns:
- Type
- Promise
(async) deepClean() → {Promise.<void>}
Deep Clean: Keep all keys, account data, wallet maps (name and path). Dump all TX history and balance state. A rescan will be required but is not initiated automatically.
- Source:
Returns:
- Type
- Promise.<void>
(async) disconnect() → {Promise.<void>}
Disconnect from node server (client required).
- Source:
Returns:
- Type
- Promise.<void>
dump() → {Promise}
Dump database (for debugging).
- Source:
Returns:
- Returns Object.
- Type
- Promise
(async) encryptKeys(b, wid, key) → {Promise}
Encrypt all imported keys for a wallet.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
wid |
Number | |
key |
Buffer |
- Source:
Returns:
- Type
- Promise
(async) ensure(options) → {Promise.<Wallet>}
Attempt to create wallet, return wallet if already exists.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object | See Wallet. |
- Source:
Returns:
- Type
- Promise.<Wallet>
(async) ensureWID(id) → {Promise.<Number>}
Map wallet id to wid.
Parameters:
Name | Type | Description |
---|---|---|
id |
String | Number |
- Source:
Returns:
- Type
- Promise.<Number>
(async) estimateFee(blocks) → {Promise.<Number>}
Estimate smart fee from chain server.
Parameters:
Name | Type | Description |
---|---|---|
blocks |
Number |
- Source:
Returns:
- Type
- Promise.<Number>
(async) get(id) → {Promise.<?Wallet>}
Get a wallet from the database, setup watcher.
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | String |
- Source:
Returns:
- Type
- Promise.<?Wallet>
(async) getAccount(wid, index) → {Promise.<Account>}
Get an account from the database by wid.
Parameters:
Name | Type | Description |
---|---|---|
wid |
Number | |
index |
Number | Account index. |
- Source:
Returns:
- Type
- Promise.<Account>
(async) getAccountHashes(wid, account) → {Promise.<Array.<Hash>>}
Get all account address hashes.
Parameters:
Name | Type | Description |
---|---|---|
wid |
Number | |
account |
Number |
- Source:
Returns:
- Type
- Promise.<Array.<Hash>>
(async) getAccountIndex(wid, name) → {Promise.<Number>}
Lookup the corresponding account name's index.
Parameters:
Name | Type | Description |
---|---|---|
wid |
Number | |
name |
String | Account name/index. |
- Source:
Returns:
- Type
- Promise.<Number>
(async) getAccountName(wid, index) → {Promise.<(String|null)>}
Lookup the corresponding account index's name.
Parameters:
Name | Type | Description |
---|---|---|
wid |
Number | |
index |
Number |
- Source:
Returns:
- Type
- Promise.<(String|null)>
(async) getAccounts(wid) → {Promise.<Array.<String>>}
List account names and indexes from the db.
Parameters:
Name | Type | Description |
---|---|---|
wid |
Number |
- Source:
Returns:
- Returns Array.
- Type
- Promise.<Array.<String>>
(async) getBlock(height) → {Promise.<?BlockMeta>}
Get a wallet block meta.
Parameters:
Name | Type | Description |
---|---|---|
height |
Number |
- Source:
Returns:
- Type
- Promise.<?BlockMeta>
(async) getBlockMap(height) → {Promise.<(records.MapRecord|null)>}
Get a wallet map.
Parameters:
Name | Type | Description |
---|---|---|
height |
Number |
- Source:
Returns:
- Type
- Promise.<(records.MapRecord|null)>
(async) getBlockTime(height) → {Promise.<?Number>}
Get block time.
Parameters:
Name | Type | Description |
---|---|---|
height |
Number |
- Source:
Returns:
- Type
- Promise.<?Number>
(async) getCoin(hash, index) → {Promise.<Object>}
Get UTXO from node.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash | |
index |
Number |
- Source:
Returns:
- Type
- Promise.<Object>
(async, private) getDepth() → {Promise}
Get current wallet wid depth.
- Source:
Returns:
- Type
- Promise
(async) getHashes() → {Promise.<Array.<Hash>>}
Get all address hashes.
- Source:
Returns:
- Type
- Promise.<Array.<Hash>>
(async) getID(wid) → {Promise.<?String>}
Map wallet wid to id.
Parameters:
Name | Type | Description |
---|---|---|
wid |
Number |
- Source:
Returns:
- Type
- Promise.<?String>
(async) getMap(key) → {Promise.<(records.MapRecord|null)>}
Get a wallet map.
Parameters:
Name | Type | Description |
---|---|---|
key |
Buffer |
- Source:
Returns:
- Type
- Promise.<(records.MapRecord|null)>
(async) getMedianTime(height, timeopt) → {Promise.<Number>}
Calculate median time past.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
height |
Number | ||
time |
Number |
<optional> |
- Source:
Returns:
- Type
- Promise.<Number>
(async) getNameMap(nameHash) → {Promise.<(records.MapRecord|null)>}
Get a wallet map.
Parameters:
Name | Type | Description |
---|---|---|
nameHash |
Hash |
- Source:
Returns:
- Type
- Promise.<(records.MapRecord|null)>
(async) getNameStatus(nameHash) → {Promise.<Object>}
Get name state.
Parameters:
Name | Type | Description |
---|---|---|
nameHash |
Buffer |
- Source:
Returns:
- Type
- Promise.<Object>
(async) getOutpointMap(hash, index) → {Promise.<(records.MapRecord|null)>}
Get a wallet map.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash | |
index |
Number |
- Source:
Returns:
- Type
- Promise.<(records.MapRecord|null)>
(async) getOutpoints() → {Promise.<Array.<Outpoint>>}
Get all outpoints.
- Source:
Returns:
- Type
- Promise.<Array.<Outpoint>>
(async) getPath(wid, hash) → {Promise.<(Path|null)>}
Retrieve path by hash.
Parameters:
Name | Type | Description |
---|---|---|
wid |
Number | |
hash |
Hash |
- Source:
Returns:
- Type
- Promise.<(Path|null)>
(async) getPathMap(hash) → {Promise.<(records.MapRecord|null)>}
Get a wallet map.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash |
- Source:
Returns:
- Type
- Promise.<(records.MapRecord|null)>
(async) getRenewalBlock() → {Promise.<Buffer>}
Get renewal block hash.
- Source:
Returns:
- Type
- Promise.<Buffer>
(async) getState() → {Promise.<(records.ChainState|null)>}
Get the best block hash.
- Source:
Returns:
- Type
- Promise.<(records.ChainState|null)>
(async) getTip() → {Promise.<BlockMeta>}
Get wallet tip.
- Source:
Returns:
- Type
- Promise.<BlockMeta>
(async) getTXMap(hash) → {Promise.<(records.MapRecord|null)>}
Get a wallet map.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash |
- Source:
Returns:
- Type
- Promise.<(records.MapRecord|null)>
(async) getWalletHashes(wid) → {Promise.<Array.<Hash>>}
Get all address hashes.
Parameters:
Name | Type | Description |
---|---|---|
wid |
Number |
- Source:
Returns:
- Type
- Promise.<Array.<Hash>>
(async) getWalletPaths(wid) → {Promise.<Array.<Path>>}
Get all paths for a wallet.
Parameters:
Name | Type | Description |
---|---|---|
wid |
Number |
- Source:
Returns:
- Type
- Promise.<Array.<Path>>
(async) getWallets() → {Promise.<Array.<String>>}
Get all wallet names.
- Source:
Returns:
- Type
- Promise.<Array.<String>>
(async) getWalletsByTX(tx) → {Promise.<Set.<Number>>}
Get all wallet ids by output addresses and outpoints.
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX |
- Source:
Returns:
- Type
- Promise.<Set.<Number>>
(async) getWID(id) → {Promise.<Number>}
Map wallet id to wid.
Parameters:
Name | Type | Description |
---|---|---|
id |
String |
- Source:
Returns:
- Type
- Promise.<Number>
(async) has(id) → {Promise.<Boolean>}
Test for the existence of a wallet.
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | String |
- Source:
Returns:
- Type
- Promise.<Boolean>
(async) hasAccount(wid, index) → {Promise.<Boolean>}
Test for the existence of an account.
Parameters:
Name | Type | Description |
---|---|---|
wid |
Number | |
index |
Number |
- Source:
Returns:
- Type
- Promise.<Boolean>
(async) hasMap(key, wid) → {Promise.<Boolean>}
Does wdb have wallet map.
Parameters:
Name | Type | Description |
---|---|---|
key |
Buffer | |
wid |
Number |
- Source:
Returns:
- Type
- Promise.<Boolean>
(async) hasNameMap(nameHash, wid) → {Promise.<Boolean>}
Has wid in the wallet map.
Parameters:
Name | Type | Description |
---|---|---|
nameHash |
Buffer | |
wid |
Number |
- Source:
Returns:
- Type
- Promise.<Boolean>
(async) hasPath(wid, hash) → {Promise.<Boolean>}
Test whether a wallet contains a path.
Parameters:
Name | Type | Description |
---|---|---|
wid |
Number | |
hash |
Hash |
- Source:
Returns:
- Type
- Promise.<Boolean>
increment(b, wid)
Increment the wid depth.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
wid |
Number |
- Source:
(private) init()
Initialize walletdb.
- Source:
(async) isAvailable(nameHash) → {Promise.<Boolean>}
Test whether name is available for CLAIM.
Parameters:
Name | Type | Description |
---|---|---|
nameHash |
Buffer |
- Source:
Returns:
- Type
- Promise.<Boolean>
liveHeight() → {Number}
Will return the current height and will increment to the current height of a block currently being added to the wallet.
- Source:
Returns:
- Type
- Number
(async) loadState() → {Promise.<void>}
Recover state from the cache.
- Source:
Returns:
- Type
- Promise.<void>
(async) open() → {Promise.<void>}
Open the walletdb, wait for the database to load.
- Source:
Returns:
- Type
- Promise.<void>
(async) preloadAll() → {Promise.<void>}
Preload all wallets.
- Source:
Returns:
- Type
- Promise.<void>
(async) readPath(wid, hash) → {Promise.<(Path|null)>}
Retrieve path by hash.
Parameters:
Name | Type | Description |
---|---|---|
wid |
Number | |
hash |
Hash |
- Source:
Returns:
- Type
- Promise.<(Path|null)>
(async) recalculateBalances() → {Promise.<void>}
Recalculate balances from the coins.
- Source:
Returns:
- Type
- Promise.<void>
register(wallet)
Register an object with the walletdb.
Parameters:
Name | Type | Description |
---|---|---|
wallet |
Wallet |
- Source:
(async) remove(id) → {Promise.<Boolean>}
Remove a wallet.
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | String |
- Source:
Returns:
- Type
- Promise.<Boolean>
(async) removeBlock(entry) → {Promise.<Number>}
Unconfirm a block's transactions and write the new best hash (SPV version).
Parameters:
Name | Type | Description |
---|---|---|
entry |
ChainEntry |
- Source:
Returns:
- number of txs removed.
- Type
- Promise.<Number>
(async) removeBlockMap(b, height, wid) → {Promise}
Remove wid from a wallet map.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
height |
Number | |
wid |
Number |
- Source:
Returns:
- Type
- Promise
(async) removeMap(b, key, wid) → {Promise}
Remove wid from a wallet map.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
key |
Buffer | |
wid |
Number |
- Source:
Returns:
- Type
- Promise
(async) removeNameMap(b, nameHash, wid) → {Promise}
Remove wid from a wallet map.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
nameHash |
Hash | |
wid |
Number |
- Source:
Returns:
- Type
- Promise
(async) removeOutpointMap(b, hash, index, wid) → {Promise}
Remove wid from a wallet map.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
hash |
Hash | |
index |
Number | |
wid |
Number |
- Source:
Returns:
- Type
- Promise
(async) removePathMap(b, hash, wid) → {Promise}
Remove wid from a wallet map.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
hash |
Hash | |
wid |
Number |
- Source:
Returns:
- Type
- Promise
(async) removeTXMap(b, hash, wid) → {Promise}
Remove wid from a wallet map.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
hash |
Hash | |
wid |
Number |
- Source:
Returns:
- Type
- Promise
(async) rename(wallet, id) → {Promise}
Rename a wallet.
Parameters:
Name | Type | Description |
---|---|---|
wallet |
Wallet | |
id |
String |
- Source:
Returns:
- Type
- Promise
renameAccount(b, account, name)
Rename an account.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
account |
Account | |
name |
String |
- Source:
(async) rescan(height) → {Promise.<void>}
Force a rescan.
Parameters:
Name | Type | Description |
---|---|---|
height |
Number |
- Source:
Returns:
- Type
- Promise.<void>
(async, private) rescanBlock(entry, txs) → {Promise}
Rescan a block.
Parameters:
Name | Type | Description |
---|---|---|
entry |
ChainEntry | |
txs |
Array.<TX> |
- Source:
Returns:
- Type
- Promise
(async) rescanBlockInteractive(entry, txs) → {Promise.<ScanAction>}
Rescan a block interactively.
Parameters:
Name | Type | Description |
---|---|---|
entry |
ChainEntry | |
txs |
Array.<TX> |
- Source:
Returns:
- interactive action
- Type
- Promise.<ScanAction>
(async) resend() → {Promise}
Resend all pending transactions.
- Source:
Returns:
- Type
- Promise
(async, private) resendPending(wid) → {Promise}
Resend all pending transactions for a specific wallet.
Parameters:
Name | Type | Description |
---|---|---|
wid |
Number |
- Source:
Returns:
- Type
- Promise
(async) resetChain(entry) → {Promise}
Handle a chain reset.
Parameters:
Name | Type | Description |
---|---|---|
entry |
ChainEntry |
- Source:
Returns:
- Type
- Promise
(private) resetFilter() → {Promise}
Reset remote filter.
- Source:
Returns:
- Type
- Promise
(async) revert(target) → {Promise.<Number>}
Revert TXDB to an older state.
Parameters:
Name | Type | Description |
---|---|---|
target |
Number |
- Source:
Returns:
- Type
- Promise.<Number>
(async) rollback(height) → {Promise}
Sync with chain height.
Parameters:
Name | Type | Description |
---|---|---|
height |
Number |
- Source:
Returns:
- Type
- Promise
save(b, wallet)
Save a wallet to the database.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
wallet |
Wallet |
- Source:
saveAccount(b, account)
Save an account to the database.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
account |
Account |
- Source:
(async) saveGenesis() → {Promise.<void>}
Add genesis block.
- Source:
Returns:
- Type
- Promise.<void>
(async) saveKey(b, wid, ring) → {Promise}
Save an address to the path map.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
wid |
Number | |
ring |
WalletKey |
- Source:
Returns:
- Type
- Promise
(async) savePath(b, wid, path) → {Promise}
Save a path to the path map.
The path map exists in the form of:
p[address-hash] -> wid map
P[wid][address-hash] -> path data
r[wid][account-index][address-hash] -> dummy
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
wid |
Number | |
path |
Path |
- Source:
Returns:
- Type
- Promise
(async) scan(heightopt) → {Promise.<void>}
Rescan blockchain from a given height. Needs this.rescanning = true to be set from the caller.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
height |
Number |
<optional> |
this.state.startHeight |
- Source:
Returns:
- Type
- Promise.<void>
(async, private) scanInteractive(heightopt, fullLockopt) → {Promise.<void>}
Interactive scan blockchain from a given height. Expect this.rescanning to be set to true.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
height |
Number |
<optional> |
this.state.startHeight | |
fullLock |
Boolean |
<optional> |
true |
- Source:
Returns:
- Type
- Promise.<void>
(async) send(tx) → {Promise.<void>}
Broadcast a transaction via chain server.
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX |
- Source:
Returns:
- Type
- Promise.<void>
(async) sendClaim(claim) → {Promise.<void>}
Broadcast a claim via chain server.
Parameters:
Name | Type | Description |
---|---|---|
claim |
Claim |
- Source:
Returns:
- Type
- Promise.<void>
(async) setTip(tip, checkMark) → {Promise}
Sync the current chain state to tip.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
tip |
BlockMeta | ||
checkMark |
Boolean | false | should we check startHeight/mark. This should only happen if we are progressing forward in history and have txs. |
- Source:
Returns:
- Type
- Promise
(async, private) syncChain() → {Promise.<void>}
Connect and sync with the chain server. Part of syncNode.
- Source:
Returns:
- Type
- Promise.<void>
(private) syncFilter() → {Promise.<Object>}
Send filter to the remote node.
- Source:
Returns:
- Type
- Promise.<Object>
(async) syncInitState() → {Promise.<void>}
Initialize and write initial sync state.
- Source:
Returns:
- Type
- Promise.<void>
(async) syncNode() → {Promise.<void>}
Sync state with server on every connect.
- Source:
Returns:
- Type
- Promise.<void>
(private) testFilter(data) → {Boolean}
Test the bloom filter against a tx or address hash.
Parameters:
Name | Type | Description |
---|---|---|
data |
Hash |
- Source:
Returns:
- Type
- Boolean
unregister(wallet)
Unregister a object with the walletdb.
Parameters:
Name | Type | Description |
---|---|---|
wallet |
Wallet |
- Source:
(async) verifyNetwork() → {Promise.<void>}
Verify network.
- Source:
Returns:
- Type
- Promise.<void>
(async, private) watch() → {Promise.<void>}
Watch addresses and outpoints.
- Source:
Returns:
- Type
- Promise.<void>
(async) wipe() → {Promise}
Wipe the txdb - NEVER USE.
- Source:
Returns:
- Type
- Promise
writeVersion(b, version)
Write chaindb version.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
version |
Number |
- Source: