Skip to content

Commit

Permalink
if no listeners, set domain to localhost:18000, else set to first lis…
Browse files Browse the repository at this point in the history
…tener (#1445)

* if no listeners, set domain to localhost:18000, else set to first listener

* save utxo ops to db when initializing db w/ genesis block
  • Loading branch information
lazynina authored Feb 28, 2025
1 parent 2e6b44d commit 88a0699
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions lib/db_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5428,6 +5428,12 @@ func InitDbWithDeSoGenesisBlock(params *DeSoParams, handle *badger.DB,
UtxoOps: utxoOpsForBlock,
})
}
if err := handle.Update(func(txn *badger.Txn) error {
return PutUtxoOperationsForBlockWithTxn(txn, snap, 0, blockHash, utxoOpsForBlock, eventManager)
}); err != nil {
return fmt.Errorf(
"InitDbWithDeSoGenesisBlock: Error putting utxo operations for block: %v", err)
}
// Flush all the data in the view.
if err := utxoView.FlushToDb(0); err != nil {
return fmt.Errorf(
Expand Down
4 changes: 2 additions & 2 deletions lib/pos_server_regtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ func (srv *Server) submitRegtestValidatorRegistrationTxns(block *MsgDeSoBlock) {
var domain string
if len(srv.GetConnectionManager().listeners) == 0 {
domain = "localhost:18000"
} else {
domain = srv.GetConnectionManager().listeners[0].Addr().String()
}
domain = srv.GetConnectionManager().listeners[0].Addr().String()

txnMeta := RegisterAsValidatorMetadata{
Domains: [][]byte{[]byte(domain)},
DisableDelegatedStake: false,
Expand Down

0 comments on commit 88a0699

Please sign in to comment.