Skip to content

Commit 11fcc48

Browse files
committed
add load_on_startup
1 parent aa19842 commit 11fcc48

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

gelements/elementsd.go

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"encoding/json"
77
"errors"
88
"fmt"
9-
"github.com/sputn1ck/glightning/jrpc2"
109
"io/ioutil"
1110
"log"
1211
"math"
@@ -15,6 +14,8 @@ import (
1514
"strconv"
1615
"sync/atomic"
1716
"time"
17+
18+
"github.com/sputn1ck/glightning/jrpc2"
1819
)
1920

2021
// taken from bitcoind
@@ -652,20 +653,21 @@ func (b *Elements) CreateWallet(walletName string) (string, error) {
652653
}
653654

654655
type LoadWalletReq struct {
655-
FileName string `json:"filename"`
656+
FileName string `json:"filename"`
657+
LoadOnStartup bool `json:"load_on_startup"`
656658
}
657659

658660
func (r *LoadWalletReq) Name() string {
659661
return "loadwallet"
660662
}
661663

662-
func (b *Elements) LoadWallet(fileName string) (string, error) {
664+
func (b *Elements) LoadWallet(fileName string, loadOnStartup bool) (string, error) {
663665
var resp WalletRes
664666
err := b.request(&LoadWalletReq{
665-
FileName: fileName,
667+
FileName: fileName,
668+
LoadOnStartup: loadOnStartup,
666669
}, &resp)
667670
return resp.WalletName, err
668-
669671
}
670672

671673
type ListWalletsReq struct{}
@@ -722,21 +724,21 @@ func (r *GetBlockHeaderReq) Name() string {
722724
}
723725

724726
type GetBlockHeaderRes struct {
725-
Hash string `json:"hash"`
726-
Confirmations uint32 `json:"confirmations"`
727-
Height uint32 `json:"height"`
728-
Version uint32 `json:"version"`
729-
VersionHex string `json:"versionHex"`
730-
Merkleroot string `json:"merkleroot"`
731-
Time uint64 `json:"time"`
732-
Mediantime uint64 `json:"mediantime"`
733-
Nonce uint32 `json:"nonce"`
734-
Bits string `json:"bits"`
727+
Hash string `json:"hash"`
728+
Confirmations uint32 `json:"confirmations"`
729+
Height uint32 `json:"height"`
730+
Version uint32 `json:"version"`
731+
VersionHex string `json:"versionHex"`
732+
Merkleroot string `json:"merkleroot"`
733+
Time uint64 `json:"time"`
734+
Mediantime uint64 `json:"mediantime"`
735+
Nonce uint32 `json:"nonce"`
736+
Bits string `json:"bits"`
735737
Difficulty float64 `json:"difficulty"`
736-
Chainwork string `json:"chainwork"`
737-
NTx uint32 `json:"nTx"`
738-
Previousblockhash string `json:"previousblockhash"`
739-
Nextblockhash string `json:"nextblockhash"`
738+
Chainwork string `json:"chainwork"`
739+
NTx uint32 `json:"nTx"`
740+
Previousblockhash string `json:"previousblockhash"`
741+
Nextblockhash string `json:"nextblockhash"`
740742
}
741743

742744
func (b *Elements) GetBlockHeader(blockHash string) (*GetBlockHeaderRes, error) {

0 commit comments

Comments
 (0)