[lbry] blockchain: make UTXO in Genesis block spendable
This commit is contained in:
parent
53553df4a8
commit
c8abd8fe93
1 changed files with 14 additions and 0 deletions
|
@ -1764,6 +1764,20 @@ func New(config *Config) (*BlockChain, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Helper function to insert the output in genesis block in to the
|
||||||
|
// transaction database.
|
||||||
|
fn := func(dbTx database.Tx) error {
|
||||||
|
genesisBlock := btcutil.NewBlock(b.chainParams.GenesisBlock)
|
||||||
|
view := NewUtxoViewpoint()
|
||||||
|
if err := view.connectTransactions(genesisBlock, nil); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return dbPutUtxoView(dbTx, view)
|
||||||
|
}
|
||||||
|
if err := b.db.Update(fn); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
// Perform any upgrades to the various chain-specific buckets as needed.
|
// Perform any upgrades to the various chain-specific buckets as needed.
|
||||||
if err := b.maybeUpgradeDbBuckets(config.Interrupt); err != nil {
|
if err := b.maybeUpgradeDbBuckets(config.Interrupt); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in a new issue