rpcserver: fix wrong unit used in PushAmountSat

This commit is contained in:
yyforyongyu
2022-05-15 01:50:30 +08:00
parent 2c4136da1b
commit 6b34ebbe44
2 changed files with 11 additions and 7 deletions

View File

@@ -4085,9 +4085,11 @@ func createRPCOpenChannel(r *rpcServer, dbChannel *channeldb.OpenChannel,
// is the push amount. Otherwise, our starting balance is the push
// amount. If there is no push amount, these values will simply be zero.
if dbChannel.IsInitiator {
channel.PushAmountSat = uint64(dbChannel.InitialRemoteBalance)
amt := dbChannel.InitialRemoteBalance.ToSatoshis()
channel.PushAmountSat = uint64(amt)
} else {
channel.PushAmountSat = uint64(dbChannel.InitialLocalBalance)
amt := dbChannel.InitialLocalBalance.ToSatoshis()
channel.PushAmountSat = uint64(amt)
}
if len(dbChannel.LocalShutdownScript) > 0 {