walletrpc: add new RemoveTransaction endpoint.
The RemoveTransaction endpoint removes the transaction with the provided txid including all its descendants from the internal wallet. We still keep watching for the address of the transation in case the transcation is confirmed nonetheless. This command is particular useful for neutrino backends because new bitcoind versions do not reply with an invalid transaction error code when the tx published fails to be included into the mempool (fullnodes do).
This commit is contained in:
8 files changed
+910
-561
No files matched your search
@@ -447,6 +447,31 @@ func RegisterWalletKitJSONCallbacks(registry map[string]func(ctx context.Context
|
||||
callback(string(respBytes), nil)
|
||||
}
|
||||
|
||||
registry["walletrpc.WalletKit.RemoveTransaction"] = func(ctx context.Context,
|
||||
conn *grpc.ClientConn, reqJSON string, callback func(string, error)) {
|
||||
|
||||
req := &GetTransactionRequest{}
|
||||
err := marshaler.Unmarshal([]byte(reqJSON), req)
|
||||
if err != nil {
|
||||
callback("", err)
|
||||
return
|
||||
}
|
||||
|
||||
client := NewWalletKitClient(conn)
|
||||
resp, err := client.RemoveTransaction(ctx, req)
|
||||
if err != nil {
|
||||
callback("", err)
|
||||
return
|
||||
}
|
||||
|
||||
respBytes, err := marshaler.Marshal(resp)
|
||||
if err != nil {
|
||||
callback("", err)
|
||||
return
|
||||
}
|
||||
callback(string(respBytes), nil)
|
||||
}
|
||||
|
||||
registry["walletrpc.WalletKit.SendOutputs"] = func(ctx context.Context,
|
||||
conn *grpc.ClientConn, reqJSON string, callback func(string, error)) {
|
||||
|
||||
|
||||
Reference in new issue
Block a user