Support onboarding & Drop faucet (#119)

* Renaming

* Add server-side support for onboarding

* add onboard --amount command

* support client side onboarding

* Drop dummy tx builder

* Drop faucet

* Fixes

* fix public key encoding

* fix schnorr pub key check in validation

* fix server/README to accomodate onboarding

---------

Co-authored-by: Louis <louis@vulpem.com>
Co-authored-by: João Bordalo <bordalix@users.noreply.github.com>
This commit is contained in:
Pietralberto Mazza
2024-02-23 16:24:00 +01:00
committed by GitHub
parent a95a829b20
commit 1650ea5935
37 changed files with 1190 additions and 2079 deletions

View File

@@ -82,7 +82,7 @@ func (s *sweeper) schedule(
task := s.createTask(roundTxid, congestionTree)
fancyTime := time.Unix(expirationTimestamp, 0).Format("2006-01-02 15:04:05")
log.Debugf("scheduled sweep task at %s", fancyTime)
log.Debugf("scheduled sweep for round %s at %s", roundTxid, fancyTime)
if err := s.scheduler.ScheduleTaskOnce(expirationTimestamp, task); err != nil {
return err
}
@@ -290,7 +290,7 @@ func (s *sweeper) findSweepableOutputs(
newNodesToCheck := make([]tree.Node, 0)
for _, node := range nodesToCheck {
isPublished, blocktime, err := s.wallet.IsTransactionPublished(ctx, node.Txid)
isConfirmed, blocktime, err := s.wallet.IsTransactionConfirmed(ctx, node.Txid)
if err != nil {
return nil, err
}
@@ -298,10 +298,10 @@ func (s *sweeper) findSweepableOutputs(
var expirationTime int64
var sweepInputs []ports.SweepInput
if !isPublished {
if !isConfirmed {
if _, ok := blocktimeCache[node.ParentTxid]; !ok {
isPublished, blocktime, err := s.wallet.IsTransactionPublished(ctx, node.ParentTxid)
if !isPublished || err != nil {
isConfirmed, blocktime, err := s.wallet.IsTransactionConfirmed(ctx, node.ParentTxid)
if !isConfirmed || err != nil {
return nil, fmt.Errorf("tx %s not found", node.Txid)
}